body {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  background: linear-gradient(180deg, #000000, #000000, #3c0020, #0c0130);
  color: white;
  margin: 0; 
  padding: 80px 0 20px 0; /* 80px top padding ensures content never overlaps the top nav */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: auto;
  user-select: none;
}

/* NEW TOP NAVIGATION CSS */
.top-nav-bar {
  position: absolute;
  top: 15px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  z-index: 1000; /* Ensure it stays above other elements */
}
.top-nav-bar .logo img {
  height: 40px;
  cursor: pointer;
}
.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  display: inline-block;
}

/* Smooth transition for Question loading Fix */
.q-view-div {
    margin-top: 10px;
    margin-bottom: 30px;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    width: 95%;           
    max-width: 1200px;    
}

/* ANSWER TEXT MEDIA LIMITS */
#answer_text img, 
#answer_text video {
    max-height: 150px !important;
    max-width: 150px !important;
    height: auto;
    object-fit: contain;
    display: block;
    margin-top: 15px;
    border-radius: 6px;
}

#q_count {
    color: #575757;
}

#blurOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(15px);
  background: rgba(255,255,255,0.4);
  z-index: 9999;
  display: none;
  pointer-events: none;
}

/* MAIN LOADER SPINNER CSS */
#main-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9000;
  display: none; 
}
.wave-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
}
.wave-loader span {
  display: block;
  width: 6px;
  height: 100%;
  background-color: #ff7a00; 
  border-radius: 4px;
  animation: heartbeat-wave 1s ease-in-out infinite;
}
.wave-loader span:nth-child(1) { animation-delay: 0s; }
.wave-loader span:nth-child(2) { animation-delay: 0.1s; }
.wave-loader span:nth-child(3) { animation-delay: 0.2s; }
.wave-loader span:nth-child(4) { animation-delay: 0.3s; }
.wave-loader span:nth-child(5) { animation-delay: 0.4s; }

@keyframes heartbeat-wave {
  0%, 100% {
    transform: scaleY(0.3);
    background-color: rgba(251, 251, 251, 0.3); 
  }
  50% {
    transform: scaleY(1);
    background-color: rgb(253, 253, 253); 
  }
}

.top-right {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
}

.ml-10 {
  margin-left: 10px;
}

.openSocial, .tsl-route {
  cursor: pointer;
}

.set_title {
  color: orange;
  font-size: 16px;
  border: 2px solid #424242;
  border-radius: 6px;
  padding: 2px 4px;
  margin-left: 10px;
}

.topicNameString {
    margin-left: 10px;
}

.styled-select {
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #888;
  border-radius: 5px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.styled-select:hover {
  border-color: #444;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.styled-select:focus {
  outline: none;
  border-color: #222;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.fb {
  color: #1877F2;
}

.insta {
  background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.letterboxd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
}

.lb-svg {
  width: 18px;
  height: 18px;
  fill: #00D735;
  transition: fill 0.3s ease;
}

.letterboxd-icon:hover .lb-svg {
  fill: #1DE17D;
}

.qb-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 1; 
  transition: opacity 0.5s ease-in-out; 
}

.reaction-btn {
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(6px);
    transition: all .18s ease;
}

.reaction-btn:hover {
    background: rgba(255,255,255,.12);
    transform: scale(1.12);
}

.reaction-overlay {
    position: absolute;
    background: rgba(20,22,30,.85);
    backdrop-filter: blur(14px);
    padding: 8px 14px;
    border-radius: 30px;
    display: none;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0,0,0,.6);
    animation: fadeUp .18s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.reaction-overlay span {
    font-size: 22px;
    cursor: pointer;
    transition: all .15s ease;
    border-radius: 50%;
    padding: 6px;
    position: relative;
}

.reaction-overlay span:hover {
    transform: scale(1.35);
}

.reaction-overlay span.active {
    background: rgba(255,255,255,.14);
    box-shadow: 0 0 12px rgba(255,255,255,.25);
    transform: scale(1.3);
}
.dark-btn {
    background: #1f1f1f;
    color: #ffffff;
    border: 1px solid #1f1f1f;
    padding: 4px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.dark-btn:hover {
    background: #000000;
}

.access-code-div {
  width: 95%;
  margin: 10%;
  text-align: center;
}

.access-code-div label {
    display: block;
    margin-bottom: 6px;
}

.access-code-div .input-wrap {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.whatsapp-col {
    font-size: 20px;
    cursor: pointer;
    color: #25D366; 
    text-decoration: none;
    display: inline-block;
    animation: wp-glare 1.5s infinite ease-in-out;
}

@keyframes wp-glare {
  0% {
    text-shadow: 0 0 5px rgba(37, 211, 102, 0.2);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 15px rgba(37, 211, 102, 0.8), 
                 0 0 25px rgba(37, 211, 102, 0.6);
    transform: scale(1.15);
  }
  100% {
    text-shadow: 0 0 5px rgba(37, 211, 102, 0.2);
    transform: scale(1);
  }
}

.whatsapp-text {
    font-size: 12px;
    color: #555;
}

.react-mini {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px 8px;
  align-items: center;
}

.mini-pill {
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
}

.mini-pill sub {
  font-size: 9px;
  opacity: 0.8;
}

.reaction-btn.radiate {
    animation: plusRadiate 3s ease-out 4;
}

@keyframes plusRadiate {
    0% {
        box-shadow:
            0 0 0 0 rgba(255, 255, 255, 0.5),
            0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow:
            0 0 0 10px rgba(255, 255, 255, 0),
            0 0 0 18px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 0 0 rgba(255, 255, 255, 0);
    }
}
#searching_q_no {
    margin-left: 5px;
    margin-right: 15px;
    color: #292929;
}

.r {
    color: #ff7a00;
}
.lazy{
    filter: blur(8px);
    transition: 0.4s;
    background:#eee;
}
.lazy.loaded{
    filter: blur(0);
}

.setter {
    color: #575757;
}

.setters-wrapper {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 12px;
}

.side-margin {
    margin-left: 20px;
    margin-right: 20px;
}

/* Welcome Modal Styles */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px); 
}

.welcome-modal {
    background: #ffffff;
    color: #333333;
    padding: 30px;
    border-radius: 10px;
    max-width: 750px; 
    width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: fadeInSlideUp 0.4s ease-out;
}

.welcome-modal h2 {
    margin-top: 0;
    color: #ff7a00;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.welcome-modal ul {
    padding-left: 20px;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px; 
}

.welcome-modal .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0; 
    border: none;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s, color 0.2s;
}

.welcome-modal .close-btn:hover {
    background: #e0e0e0;
    color: #111;
}

/* Video Wrapper & Base Video Styles */
.welcome-modal .video-wrapper {
    width: 100%;
    margin-top: 15px;
    text-align: center;
}

.welcome-modal .video-wrapper video {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    width: 100%;
    height: auto;
}

/* Desktop View Default */
.desktop-video { display: block; }
.mobile-video { display: none; }

.season_title {
    font-size: 16px;
    border: 2px solid #424242;
    border-radius: 6px;
    padding: 2px 4px;
    color: #787878;
    background-color: #47434385;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= MOBILE RESPONSIVE PATCH ================= */

@media (max-width: 1330px) {
    .q-view-div {
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* Top Controls Row */
@media (max-width: 768px) {
    body {
        padding-top: 15px; /* Offset the 80px desktop top-padding so mobile stays tidy */
    }
    
    .top-nav-bar {
        position: relative; 
        top: 0;
        left: 0;
        margin-left: 0;
        margin-bottom: 12px; /* Reduced gap */
        justify-content: center;
        width: 100%;
        gap: 8px;
    }
    .nav-links {
        justify-content: center;
        gap: 6px;
    }
    .nav-links a {
        font-size: 11px; /* Sleeker, smaller top buttons */
        padding: 5px 8px;
    }

    .react-mini {
        display: flex;
        flex-wrap: wrap;
    }
    #swipeArea {
        padding: 2px; /* Reduced to squeeze space */
    }
    
    .q-view-div {
        margin-top: 5px;
        margin-bottom: 20px;
        width: 98%;
    }
    
    /* Extreme reduction of padding/margins on mobile elements */
    .side-margin {
        margin-left: 4px !important;
        margin-right: 4px !important;
    }
    
    .white-box {
        padding: 8px 12px !important; /* Shaves off unneeded whitespace inside */
    }
    
    /* ----------------------------------------------------
       GRID MAGIC for exactly 6 elements (Reset + 5 Selects)
       ---------------------------------------------------- */
    .qb-top-left {
        display: grid !important; 
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important; /* Reduced vertical/horizontal gap */
        width: 96%;
        margin: 0 auto;
        justify-content: center;
    }
    
    .filter-tags {
        /* Removes .filter-tags from the tree structure visually, 
           so the 5 selects become grid items right next to the Reset button */
        display: contents; 
    }
    
    .qb-top-left select,
    .qb-top-left button {
        font-size: 11.5px;
        padding: 5px 6px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    /* ---------------------------------------------------- */

    .question-text, #question_text, #answer_text {
        font-size: 13px !important; /* Smaller question text */
        line-height: 1.4;
    }
    
    .question-content {
        gap: 8px !important;
    }

    .setters-wrapper.has-co-setter {
        flex-direction: column; 
        align-items: flex-end; 
        gap: 2px; 
    }

    .desktop-video { display: none; }
    .mobile-video { 
        display: block; 
        max-width: 280px; 
        margin: 0 auto;
    }

    .welcome-modal {
        padding: 15px;
        max-height: 90vh; 
        overflow-y: auto; 
    }

    .welcome-modal h2 {
        font-size: 1.2rem;
        margin-top: 15px;
    }
    
    .welcome-modal ul {
        font-size: 13px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .q-view-div {
        margin-top: 5px;
        margin-bottom: 25px;
    }
    
    .topic-name {
        font-size: 13px;
    }
    
    .button-container button {
        flex: 1;
        font-size: 12px;
        padding: 6px 8px;
    }
    #find {
        display: block;
    }
}