/* COMMON STYLES - Used across all pages */

/* Prevent horizontal overflow on mobile/tablet */
html {
  overflow-x: hidden;
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

/* BASIC RESET & LAYOUT - theme.css must be loaded for variables */
body {
  font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-color, #0B0E14);
  color: var(--text-primary, #F8FAFC);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  max-width: 100vw;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---------- HEADER (Flexbox, Logo left, Actions right) ---------- */
header {
  background: var(--header-footer-color, #282828);
  color: var(--text-primary, #F8FAFC);
  padding: 12px 24px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  position: fixed;
  z-index: 1000;
}

/* Logo – far left */
.header-logo,
header > a:first-of-type {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  margin-right: auto;
}
.header-logo .logo,
header > a .logo {
  display: block;
  max-height: 60px;
  height: auto;
  max-width: 100%;
}

/* Streak indicator */
.header-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary, #8B949E);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 62, 109, 0.12);
  color: var(--accent, #FF3E6D);
}

/* Desktop actions – right side */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent, #FF3E6D);
  color: #fff;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 62, 109, 0.4);
}

.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--border-color, rgba(255,255,255,0.1));
  color: var(--text-primary, #F8FAFC);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-theme:hover {
  background: rgba(255, 62, 109, 0.2);
  transform: translateY(-1px);
}
/* Show sun when dark (click to go light), moon when light (click to go dark) */
.btn-theme .theme-icon-sun,
.btn-theme .theme-icon-moon { display: none; }
body.dark-theme .btn-theme .theme-icon-sun,
body:not(.light-theme):not(.dark-theme) .btn-theme .theme-icon-sun { display: inline; }
body.light-theme .btn-theme .theme-icon-moon { display: inline; }

main {
  margin-top: 100px !important;
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 50px;
  min-width: 0;
  background: var(--bg-color, #0B0E14);
}

main h1,
main h2 {
  color: var(--text-primary, #F8FAFC);
}

main p {
  color: var(--text-secondary, #8B949E);
}

main hr {
  border-color: var(--border-color, rgba(255,255,255,0.1));
}

/* Menu toggle – hidden on desktop, shown on mobile */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text-primary, #F8FAFC);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 12px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.menu-toggle:hover {
  background: rgba(255, 62, 109, 0.15);
}

button {
  background: var(--surface-color, #161B22);
  color: var(--accent, #FF3E6D);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 12px;
  font-size: 18px;
  font-family: inherit;
}

button:disabled,
button:disabled:hover {
  background: rgba(143, 31, 31, 0.5);
  cursor: not-allowed;
  color: var(--text-secondary, #8B949E);
}

button:hover:not(:disabled) {
  background: var(--accent, #FF3E6D);
  color: #fff;
}

/* FOOTER & SOCIAL */
footer {
  background: var(--header-footer-color, #282828);
  color: var(--text-primary, #F8FAFC);
  text-align: center;
  height: 155px !important;
  padding-top: 50px;
  width: 100%;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

header h1 {
  margin: 0;
}

input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  box-sizing: border-box;
}

.logo {
  max-height: 75px;
  height: 100%;
  display: block;
  max-width: 100%;
}

.left_container {
  max-width: 350px;
  width: 100%;
  padding-top: 24px;
  min-width: 0;
}

.main_container {
  padding: 24px;
  text-align: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.right_container {
  max-width: 350px;
  width: 100%;
  padding-top: 24px;
  min-width: 0;
}

/* SIDEBAR & GAME LIST */
.game-list {
  display: grid;
  gap: 20px;
  padding: 15px;
}

/* Main container quiz grid - 3 columns on desktop */
.main_container .game-list {
  grid-template-columns: repeat(3, 1fr);
}

/* Sidebar game list - always single column */
.left_container .game-list,
.right_container .game-list {
  grid-template-columns: 1fr;
}

.game_list_a {
  text-decoration: none;
  display: block;
  color: inherit;
}

/* Daily quiz icons in left-container sidebar (based on first tag) */
.left_container .game_list_a .game {
  display: flex;
  align-items: center;
  gap: 10px;
}

.left_container .game_list_a .game_list_a_icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--text-primary, #ffae00);
  width: 1.25em;
  text-align: center;
}

.left_container .game_list_a .game h3 {
  margin:5px;
}
/* Quiz Wrapper - contains title and ca0rd */
.quiz-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-title {
  color: var(--text-primary, #0F172A);
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  text-align: center;
}

/* Game Card - Flip Card Container */
.game-card {
  position: relative;
  min-height: 300px;
  border-radius: 14px;
  perspective: 1000px;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
}

/* Inner container for flip effect */
.game-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.game-list:hover .game-card:not(:hover) .game-card-inner {
  /* Optional: slightly dim non-hovered cards */
}

.game-card:hover .game-card-inner {
  transform: rotateY(180deg);
}

/* Card Front and Back */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 300px;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.card-front {
  background-size: 200px;
  background-position: center;
  background-repeat: no-repeat;
  transform: rotateY(0deg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 15px;
}

.card-back {
  background: var(--surface-color, #161B22);
  color: var(--accent, #FF3E6D);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  transform: rotateY(180deg);
}

.card-back p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
}

/* Play Button - on both sides of card */
.play-button {
  background: var(--accent, #FF3E6D);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(255, 62, 109, 0.3);
  margin-top: 15px;
  z-index: 10;
  position: relative;
  pointer-events: auto;
}

.play-button:hover {
  background: #ff5a88;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 62, 109, 0.4);
}

/* Legacy game class for sidebar compatibility */
.game {
  /* background: var(--surface-color, #FFFFFF);
  border: 3px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  text-align: center;
  color: var(--text-primary, #0F172A);
  font-size: 12px;
  margin-top: 7px; */
}

.game:hover {
  color: var(--accent, #ffae00);
  /* border-color: var(--accent, #FF3E6D);
  background: var(--surface-color, #161B22);
  color: var(--accent, #FF3E6D); */
}

.footer_list {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.footer_list i {
  color: var(--text-primary, #F8FAFC);
}
.social_icons {
  font-size: 40px;
  color: #fff;
}

.social_icons:hover {
  color: var(--accent, #FF3E6D);
}

/* Mobile header drawer – Login + Theme (pages without sidebar) */
.mobile-header-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--surface-color, #161B22);
  z-index: 1001;
  padding: 80px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  transition: right 0.3s ease;
  border-left: 1px solid var(--border-color, rgba(255,255,255,0.1));
}
.mobile-header-drawer.open {
  right: 0;
}
.mobile-header-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-header-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.mobile-header-drawer .btn-login {
  width: 100%;
  justify-content: center;
}
.mobile-header-drawer .btn-theme {
  width: 100%;
}

/* Header actions at top of sidebar (pages with sidebar) */
.header-actions-mobile {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
}
.header-actions-mobile .btn-login { width: 100%; justify-content: center; }
.header-actions-mobile .btn-theme { width: 100%; }

.social_share_section {
  margin-top: 50px;
  margin-bottom: 50px;
}

.social_share_section h2 {
  color: var(--text-primary, #F8FAFC);
}

/* How to play and other main content text – theme-aware */
.how_to_play,
.main_container .how_to_play {
  color: var(--text-primary, #F8FAFC);
}

.how_to_play h2,
.how_to_play h3,
.main_container h1,
.main_container h2,
.main_container h3,
.main_container p,
.main_container li,
.main_container ul {
  color: var(--text-primary, #F8FAFC);
}

.how_to_play p,
.how_to_play li {
  color: var(--text-primary, #F8FAFC);
  line-height: 1.6;
}

.how_to_play strong {
  color: var(--text-primary, #F8FAFC);
}

.share-buttons a {
  padding: 5px 30px;
  color: var(--text-primary, #F8FAFC);
  font-size: 36px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 10px;
}

.share-buttons a:hover {
  background: var(--header-footer-color, #282828);
  color: var(--accent, #ffae00);
}

.share-buttons i {
  margin-bottom: 20px;
}

/* DATE CONTROLS */
#dateContainer {
  gap: 10px;
  margin-bottom: 20px;
}

#datePicker {
  max-width: 200px;
  width: 50%;
}

/* Vibe Check Banner Styles */
.vibe_check_bunner {
  margin: 10px 10px 50px 10px;
}

.vibe_check_bunner a {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 15px;
}

.vibe_check_bunner img {
  width: 100%;
  max-width: 330px;
  height: auto;
  display: block;
  border-radius: 15px;
  object-fit: cover;
}
.vibe_check_bunner a:hover img {
  transform: scale(1.02);
}

.know-me_bunner {
  margin: 10px 10px 50px 10px;
}

.know-me_bunner a {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 15px;
}
.know-me_bunner img {
  width: 100%;
  max-width: 330px;
  height: auto;
  display: block;
  border-radius: 15px;
  object-fit: cover;
}
.know-me_bunner a:hover img {
  transform: scale(1.02);
}

.bigtale_quize_img {
  max-width: 330px;
}

.bigtale_quize {
  position: relative;
  text-align: center;
  background-color: var(--surface-color, #161B22);
  color: var(--text-primary, #F8FAFC);
  border-radius: 15px;
  min-height: 300px;
  padding-top: 10px;
  margin: 10px;
  max-width: calc(100% - 18px);
  width: auto;
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.social-icon-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  width: 50px;
}

/* Sidebar styles for quizzes_links.js */
.static-header {
  color: var(--text-primary, #F8FAFC);
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.static-content {
  /* display: grid; */
  /* gap: 20px; */
  padding: 15px;
  padding-top: 0px;
}

.accordion-header {
  color: var(--text-primary, #F8FAFC);
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.accordion-header.active {
  color: var(--accent, #ffae00);
}

.accordion-content {
  display: grid;
  gap: 20px;
  padding: 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  max-height: 2000px;
}

.faq_right_container {
  padding: 20px 10px;
}

.faq_right_container h3 {
  color: var(--text-primary, #F8FAFC);
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.faq_right_container p {
  color: var(--text-secondary, #8B949E);
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Container for the floating suggestions */
.suggestions-list {
  position: absolute;
  z-index: 1000;
  background: var(--surface-color, #161B22);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  display: none;
  list-style: none;
  padding: 0;
  margin-top: 10px;
  width: 100%;
  top: 100%;
  left: 0;
}

.suggestion-item,
.suggestions-list li {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-primary, #F8FAFC);
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
  font-size: 14px;
}

.suggestion-item:hover,
.suggestions-list li:hover {
  background: var(--accent, #ffae00);
  color: var(--text-primary, #0F172A);
}

/* Modal Overlay - Popup rules */
#rulesModal.is-active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999999 !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Modal Content Box */
.modal-content {
  background: var(--surface-color, #161B22);
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  text-align: center;
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin: 10px;
  color: var(--text-primary, #F8FAFC);
}

.modal-content h2 {
  margin-top: 0;
  color: var(--text-primary, #F8FAFC);
}

.rules-text {
  text-align: left;
  line-height: 1.6;
  margin: 20px 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #8B949E);
}

/* Show class to be triggered by JS */
.modal-overlay.show {
  visibility: visible;
  opacity: 1;
}

.primary-btn:hover {
  background: var(--accent, #ffae00);
  color: var(--text-primary, #0F172A);
}

/* Hint button and container */
.hint-container {
  margin: 15px auto;
  padding: 10px;
  background: var(--surface-color, #161B22);
  border-left: 5px solid var(--accent, #ffae00);
  border-radius: 5px;
  max-width: 600px;
  min-height: 20px;
  font-style: italic;
  display: none;
  color: var(--text-secondary, #8B949E);
  padding-bottom: 0px;
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#rulesModal {
  overflow-y: auto !important;
}

/* Responsive design */
@media (max-width: 1000px) {
  body.menu-open {
    overflow: hidden;
  }
  main {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  header {
    padding: 12px 16px;
    height: auto;
  }
  footer {
    height: auto;
    padding-top: 30px;
    padding-bottom: 20px;
  }
  .menu-toggle {
    display: flex;
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    margin-left: 10px;
  }
  /* Desktop header actions: hide on mobile */
  .header-actions {
    display: none;
  }
  /* Show header actions in sidebar for pages with left_container */
  .left_container .header-actions-mobile {
    display: flex;
  }
  /* Streak: keep visible if space; slightly smaller on very narrow; push to right so menu-toggle sits next to it */
  .header-streak {
    font-size: 0.85rem;
    padding: 6px 10px;
    margin-left: auto;
  }
  .logo,
  .header-logo .logo {
    max-height: 52px;
  }
  .left_container {
    position: fixed;
    top: 0;
    left: -350px;
    width: 280px;
    height: 100%;
    background: var(--surface-color, #161B22);
    z-index: 1000;
    transition: 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    padding: 72px 16px 24px 16px;
  }
  .left_container.open {
    left: 0;
  }
  .right_container,
  .main_container {
    width: auto;
  }
  .right_container {
    max-width: 100%;
    width: auto;
    padding-top: 10px;
    margin-bottom: 20px;
  }
  /* Add scrolling to game-list on mobile */
  .left_container .game-list {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ffae00 #282828;
  }
  .game-list h3 {
    color: var(--text-primary, #ffae00);
  }
  .footer_list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 0 10px;
  }

  .social_icons {
    font-size: 30px;
  }
  .social-icon-link {
    width: 40px;
  }
  .game {
    border: 1px solid #444;
    margin: 0 10px;
    padding: 0;
  }
  
  /* Tablet: 2 columns for main container quizzes */
  .main_container .game-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Sidebar always single column */
  .left_container .game-list,
  .right_container .game-list {
    grid-template-columns: 1fr;
  }
  
  /* Adjust card height on mobile */
  .game-card {
    min-height: 250px;
  }
  
  .play-button {
    padding: 10px 25px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  /* Tablet: 2 columns for main container */
  .main_container .game-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  header {
    padding: 10px 12px;
  }
  /* Hide streak on very narrow screens if space is tight */
  .header-streak {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  #resultsTable {
    font-size: 12px;
  }
  .logo {
    max-height: 50px;
    margin-bottom: -12px;
  }
  .footer_list {
    grid-template-columns: 1fr;
  }
  
  /* Small mobile: 1 column for main container */
  .main_container .game-list {
    grid-template-columns: 1fr;
  }
  
  /* Sidebar always single column */
  .left_container .game-list,
  .right_container .game-list {
    grid-template-columns: 1fr;
  }
  
  /* Adjust card height on small mobile */
  .game-card {
    min-height: 200px;
    max-width: 350px;
  }
  
  .quiz-title {
    font-size: 1rem;
  }
  
  .card-back p {
    font-size: 0.85rem;
    padding: 15px;
  }
  
  .play-button {
    padding: 8px 20px;
    font-size: 0.85rem;
    bottom: 10px;
  }
  .logo {
    left: 0px !important;
  }
}

/* Adjust game-list max-height for shorter screens */
/* @media (max-height: 900px) {
  .left_container .game-list {
    max-height: 350px;
  }
} */
 