/* Games Page Specific Styles */

/* Mobile Navigation (hidden on desktop) */
.mobile-nav {
  display: none;
}

.platform-section {
  margin-bottom: 40px;
  background: var(--card-bg-color);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border-radius: 20px;
  border: 1px solid var(--card-border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.platform-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--card-border-color);
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.platform-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.platform-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 6px;
}

.platform-icon.steam {
  background: #1b2838;
}

.platform-icon.ea {
  background: #ff6600;
}

.platform-icon.ubisoft {
  background: #0099ff;
}

.platform-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary-text-color);
  margin: 0;
  flex: 1;
}

.platform-count {
  background: var(--accent-secondary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.collapse-indicator {
  color: var(--secondary-text-color);
  font-size: 1.2rem;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-section.collapsed .collapse-indicator {
  transform: rotate(-90deg);
}

.games-grid {
  padding: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  /*max-height: 2000px;*/
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  opacity: 1;
}

.platform-section.collapsed .games-grid {
  max-height: 0;
  padding: 0 25px;
  opacity: 0;
}

.game-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 200px;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-secondary);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.game-card:hover .game-title {
  color: var(--accent-secondary);
}

.game-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
  z-index: 1;
}

.game-card:hover .game-banner-bg {
  transform: scale(1.05);
}

.game-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.7) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.1) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 2;
}

.game-overlay::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  mask: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.1) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.1) 80%,
    rgba(0, 0, 0, 0) 100%
  );
}

.game-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: opacity 0.3s ease;
}

.game-title {
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  font-weight: 600;
  color: white;
  margin: 0;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color 0.3s ease;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.game-title span:first-child {
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.78rem, 3.2vw, 0.9rem);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.game-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.caretaker-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.new-badge {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    flex-shrink: 0;
    align-self: flex-start;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
  }
}

/* Clickable Filter Styles */
.clickable-filter {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.clickable-filter:hover {
  transform: scale(1.05);
}

.new-badge.clickable-filter:hover {
  background: linear-gradient(45deg, #ff8e8e, #ffb3b3);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}



/* Active filter states */
.new-badge.filter-active {
  background: linear-gradient(45deg, #4CAF50, #66BB6A) !important;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5) !important;
  animation: none !important;
}



/* Filter indicator for active filters */
.clickable-filter.filter-active::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
}

.new-badge.clickable-filter.filter-active::after {
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  font-size: 9px;
}

/* Search with filters styling */

#search-input.has-filters {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
  padding-right: 50px;
}

/* Clear button positioning - works with sticky search container */

.clear-filters-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-secondary);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0;
  box-sizing: border-box;
}

.clear-filters-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

.clear-filters-btn i {
  font-size: 12px;
}

/* Search functionality */
.game-card.hidden {
  display: none;
}

.platform-section.no-visible-games {
  display: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: 20px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 8px;
    margin: 0 auto 30px;
    max-width: 300px;
    gap: 8px;
  }

  .mobile-nav .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
  }

  .mobile-nav .mobile-nav-link:hover {
    color: var(--primary-text-color);
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-nav .mobile-nav-link.active {
    color: var(--primary-text-color);
    background: linear-gradient(
      90deg,
      var(--accent-primary),
      var(--accent-secondary)
    );
  }

  .mobile-nav .mobile-nav-link i {
    font-size: 1.2rem;
  }
  .games-grid {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }

  .platform-header {
    padding: 16px 20px;
  }

  .platform-title {
    font-size: 1.3rem;
  }

  .game-card {
    height: 180px;
  }

  .game-content {
    padding: 12px;
  }

  .game-overlay {
    height: 50%;
  }

  .game-title {
    font-size: clamp(0.9rem, 3.8vw, 1rem);
    margin-bottom: 8px;
  }

  .game-meta {
    font-size: 0.8rem;
    gap: 6px;
  }

  .header-nav {
    display: none;
  }

  .floating-header {
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .platform-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .platform-count {
    order: 3;
    margin-left: auto;
  }

  .collapse-indicator {
    order: 2;
  }
}

/* Loading states */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--secondary-text-color);
}

.loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--secondary-text-color);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.plausible-event-name\=Game\+Card\+Click {}

/* Tiny devices improvements */
@media (max-width: 360px) {
  .platform-header { padding: 14px 16px; }
  .platform-title { font-size: clamp(1.05rem, 6vw, 1.25rem); }
  .games-grid { padding: 12px; gap: 12px; }
  .game-card { border-radius: 10px; }
  /*.clear-filters-btn { width: 36px; height: 36px; }*/
}
.plausible-event-name\=Platform\+Toggle\+STEAM {}
.plausible-event-name\=Platform\+Toggle\+EA {}
.plausible-event-name\=Platform\+Toggle\+UBISOFT {}

.plausible-event-name\=Filter\+New\+Games\+Click {}
.plausible-event-name\=Clear\+Filters\+Button {}

@media (max-width: 768px) {
  .header-search:not(.search-active) .clear-filters-btn {
    display: none !important;
  }
}