/* =========================
   GLOBAL
   ========================= */

:root {
  --page-bg: #F7E5D7;
  --text: #1f2933;
}

/* Global layout and base styles */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--page-bg);
  font-family: 'Roboto', sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

/* =========================
   HEADER / NAV (MATCH FINDER)
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 24px;
  background-color: var(--page-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.logo {
  height: 56px;
  width: auto;
  display: block;
}

/* Desktop nav */
.navigation {
  margin-left: 0;
  flex: 0 0 auto;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  align-items: center;
}

.navigation ul li {
  margin: 0;
  padding: 0;
}

.navigation ul li a {
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #333;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Active link */
.navigation ul li a.active {
  background-color: #3E0076;
  color: #ffffff;
}

/* Hover */
.navigation ul li a:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #111;
}

/* Mobile menu button */
.menu-button {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

/* Mobile header layout */
@media (max-width: 768px) {
  .site-header {
    justify-content: center;
    padding: 10px 16px;
  }

  .logo {
    height: 48px;
  }

  .menu-button {
    display: block;
    position: absolute;
    left: 12px;
    top: 12px;
  }

  .navigation {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    background-color: var(--page-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
  }

  .navigation.open {
    display: block;
  }

  .navigation ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 4px 12px;
  }

  .navigation ul li a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
  }
}

/* =========================
   SEARCH ALL PAGE CONTENT
   ========================= */

/* Main section titles on search pages */
#all-comedians > h1,
#all-specials > h1 {
  text-align: center;
  margin: 20px 0;
  font-size: 2em;
  color: #333;
  font-family: "Montserrat", sans-serif;
  margin-top: 0;
  padding-top: 0;
}

#all-comedians, #all-specials {
  max-width: 1200px;
  margin: 40px auto 0;   /* pushes the whole section down */
  padding: 24px 16px 40px;
}

@media (max-width: 768px) {
  #all-comedians, #all-specials {
    margin-top: 60px;
  }
}

/* Back and search bar layout */
.back-and-search {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
  padding: 0 10px;
  flex-wrap: nowrap;
}

.back-button {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: bold;
  background-color: #FFF;
  border-radius: 8px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #ddd;
  white-space: nowrap;
  line-height: 1;
  gap: 5px;
  margin-right: 10px;
}

.back-button:hover {
  background-color: #f0f0f0;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  flex-grow: 1;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 8px 50px 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 16px;
  outline: none;
}

.clear-button {
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  display: none;
}

.clear-button:hover {
  color: #555;
}

/* Comedian and special lists */
#comedian-list {
  display: flex;
  flex-wrap: wrap;
  gap: 35px;
  justify-content: center;
  padding: 10px;
  align-items: stretch;
}

#special-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  justify-items: center;
  padding: 10px;
}

@media (max-width: 768px) {
  #special-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 480px) {
  #special-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
  }
}

/* Cards for comedians and specials */
.special,
.special-preview,
.comedian,
.comedian-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 120px;
  max-width: 120px;
  height: auto;
  padding: 15px;
  background-color: transparent;
  border-radius: 15px;
  text-align: center;
  box-shadow:
    0px 1px 2px rgba(0, 0, 0, 0.1),
    0px 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}

.comedian img,
.comedian-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  margin-bottom: 5px;
}

.special img,
.special-preview img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  margin-bottom: 5px;
}

/* Text in cards */
.comedian p,
.comedian-preview p,
.special p,
.special-preview p {
  font-size: 14px;
  color: #333;
  margin: 5px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.special-title {
  font-weight: bold;
  margin: 5px 0;
  height: calc(1.2em * 3);
  line-height: 1.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.special-comedian {
  font-size: 12px;
  color: #777;
  margin: 0;
  font-weight: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover effect */
.comedian:hover,
.comedian-preview:hover,
.special:hover,
.special-preview:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow:
    0px 8px 20px rgba(0, 0, 0, 0.15),
    0px 6px 18px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 1);
}

/* Platform filter bar */
#platform-filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0 5px 0;
  flex-wrap: wrap;
}

.platform-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.platform-button img {
  width: 50px;
  height: auto;
}

.platform-button.active {
  transform: scale(1.1);
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

button.reset {
  background-color: #ff4d4d;
  color: white;
  padding: 8px 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.platform-button.reset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Platform logo inside cards */
.platform-logo-container {
  width: 60%;
  height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 5px auto;
  overflow: hidden;
  padding: 15px 0;
  background: transparent;
  box-shadow: none !important;
}

.platform-logo {
  width: auto;
  height: 16px;
  max-width: 80%;
  object-fit: contain !important;
  object-position: center;
  display: block;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Filter helper text */
#filter-info {
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: #5C4033;
  margin-top: 0;
  margin-bottom: 25px;
  font-style: italic;
}

/* Error message box */
.error-message {
  text-align: center;
  max-width: 500px;
  margin: 50px auto;
  padding: 20px;
  background-color: #ffe5e5;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  font-family: 'Arial', sans-serif;
}

.error-message h1 {
  font-size: 22px;
  color: #cc0000;
  margin-bottom: 10px;
}

.error-message p {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
}

.retry-button {
  background-color: #cc0000;
  color: white;
  font-size: 16px;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.retry-button:hover {
  background-color: #a00000;
}

/* Scroll area where the list sits */
.scrolling-list {
  position: relative;
  min-height: 100px;
}

/* Loading spinner */
.loading-spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #5C4033;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1.5s linear infinite;
  margin: 20px auto;
}

#loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Small screen tweaks for search area */
@media (max-width: 768px) {
  .back-and-search {
    gap: 5px;
  }

  .search-container {
    width: 80%;
  }

  .search-input {
    font-size: 12px;
    padding: 8px 35px 8px 12px;
  }

  .clear-button {
    right: 28px;
  }
}

@media (max-width: 480px) {
  .search-container {
    width: 95%;
  }

  .clear-button {
    right: 25px;
  }
}