/* ==========================================================
   GLOBAL DESIGN SYSTEM — MOBILE FIRST
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* ==========================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================== */
:root {
    /* Colors */
    --bg: #121212;
    --card: #1E1E1E;
    --text: #E4E4E4;
    --muted: #D4D4D4;
    --muted-2: #BEBEBE;
    --lav: #A78BFA;
    --lav-light: #C4B5FD;
    --ink: #121212;

    /* Layout */
    --nav-h: 70px;
    --rail: 1100px;
    --pad: 16px;
}

/* ==========================================================
   BASE RESET & TYPOGRAPHY
   ========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, 
body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
}

/* ==========================================================
   NAVBAR
   ========================================================== */
.top-bar {
    background-color: var(--lav);
    height: var(--nav-h);
}

.navbar {
    padding: 0 !important;
}

.nav-inner {
    height: var(--nav-h);
    width: 100%;
    max-width: var(--rail);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    line-height: 0;
}

.logo {
    display: block;
    height: 52px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: #fff !important;
    font-weight: 600;
    margin: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    line-height: 1;
    transition: text-shadow 0.25s ease;
}

.nav-link:hover {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(196,181,253,0.9);
}

/* Hide desktop links on mobile */
@media (max-width: 991px) {
    .navbar-right {
        display: none !important;
    }
}

/* ==========================================================
   ANIMATED NEON HAMBURGER (Animated to X)
   ========================================================== */
.hamburger-animated {
    width: 34px;
    height: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2000;
}

.hamburger-animated span {
    height: 6px;
    border-radius: 3px;
    background: #200472;
    box-shadow: 0 0 4px #200472;
    transition: all 0.25s ease;
}

.hamburger-animated:hover span {
    box-shadow: 0 0 12px #C8B4FF;
}

.hamburger-animated.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
    box-shadow: 0 0 12px #C8B4FF;
}

.hamburger-animated.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-animated.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
    box-shadow: 0 0 12px #C8B4FF;
}

/* ==========================================================
   HOME LAYOUT
   ========================================================== */
.home-shell {
    padding-top: 40px;
    padding-bottom: 60px; 
}

/* Pick button row (above grid) */
.home-pick { text-align: center; }

.home-grid {
    width: 100%;
    max-width: var(--rail);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
    justify-items: center;
}

.home-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hide upload card on mobile */
@media (max-width: 991px) {
    .home-grid aside.home-panel {
        display: none;
    }
}

/* Desktop: Two-column grid */
@media (min-width: 992px) {
    .home-grid {
        grid-template-columns: 1.4fr 0.9fr;
        column-gap: 12px;
        row-gap: 14px;
        justify-items: stretch;
    }

    .home-panel {
        align-items: stretch;
    }

    .movie-card {
        width: 100%;
        margin: 0;
    }

    .upload-card-desktop {
        width: 100%;
        max-width: 420px;
        margin-left: auto;
    }
}

/* ==========================================================
   MOVIE CARD
   ========================================================== */
.movie-card {
    width: 90%;
    background-color: var(--card);
    margin: 25px auto 10px;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}

.movie-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.movie-poster {
    width: 220px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow:
        0 0 5px 5px rgba(167,139,250,0.45),
        0 5px 5px rgba(0,0,0,0.6);
}

.movie-poster-placeholder {
    width: 220px;
    height: 330px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow:
        0 0 40px 12px rgba(167,139,250,0.35),
        0 6px 18px rgba(0,0,0,0.6);
    background: #1F2933;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.movie-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.movie-overview {
    font-size: 1rem;
    margin: 12px 0;
    line-height: 1.4;
    color: var(--muted);
}

.movie-date strong {
    font-size: 0.9rem;
    font-weight: 800;
}

.movie-extra {
    font-size: 0.95rem;
    color: #ccc;
    margin: 6px 0;
}

.movie-extra strong {
    color: var(--lav);
}

/* Desktop layout for poster + info */
@media (min-width: 768px) {
    .movie-card-content {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .movie-poster {
        width: 260px;
        margin-right: 20px;
    }

    .movie-info {
        flex: 1;
    }

    .external-links {
        justify-content: flex-start;
    }
}

/* ==========================================================
   PRIMARY BUTTONS (Pick, Upload, Reset)
   ========================================================== */
.pick-btn,
.btn-danger {
    background-color: var(--lav);
    color: var(--ink);
    height: 48px;
    padding: 0 26px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    margin: 14px 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
    transition: all 0.25s ease;
}

.pick-btn:hover,
.btn-danger:hover {
    background-color: var(--lav-light);
    color: var(--ink);
}

.btn-light {
    background: #2A2A2A;
    color: var(--text) !important;
    font-weight: 600;
    border-radius: 10px;
    height: 48px;
    border: 1px solid #3A3A3A;
    transition: all 0.25s ease;
}

.btn-light:hover {
    background: #3A3A3A !important;
    color: var(--text) !important;
}

/* ==========================================================
   MOVIE CARD EXTERNAL BUTTONS (IMDb, LETTERBOXD, COPY MOVIE TITLE)
   ========================================================== */
.external-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.external-btn,
.copy-inline-btn,
.copy-btn {
    background: var(--lav);
    color: #000;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    position: relative; 
    transition: all 0.25s ease;
}

.external-btn:hover,
.copy-inline-btn:hover,
.copy-btn:hover {
    box-shadow: 0 0 10px var(--lav), 0 0 18px var(--lav);
    transform: translateY(-2px);
}

/* Tooltip for Copy button (triggered via .show-tooltip class from JS) */
.copy-inline-btn::after {
    content: "Copied!";
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #eee;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.7);
    transition: opacity 0.2s ease-in-out;
}

.copy-inline-btn.show-tooltip::after {
    opacity: 1;
}

/* ==========================================================
   ABOUT PAGE TEXT
   ========================================================== */
.about-shell {
    padding-top: 40px;
    padding-bottom: 80px;
}

.about-rail {
    width: 100%;
    max-width: var(--rail);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-intro {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
}

.about-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    max-width: 800px;
    margin-top: 20px;
    text-align: center;
    color: var(--muted);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.about-title {
    text-align: center;
    margin: 22px 0 18px;
    font-weight: 700;
}

.about-movie-btn {
    background-color: var(--card);
    padding: 12px;
    color: var(--text);
    font-family: 'Cinzel', serif;
    border-radius: 10px;
    margin-bottom: 10px;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    display: block;
    font-weight: 600;
    transition: all 0.25s ease;
}

.about-movie-btn:hover {
    background-color: var(--lav);
    color: var(--ink);
}

.guess-prompt-mobile {
    color: var(--muted-2);
}

.about-movie-grid {
    width: 100%;
    max-width: 900px;
    display: grid;
    gap: 14px;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    grid-template-columns: 1fr 1fr;
    margin: 8px auto 18px;
}

.about-guess-prompt {
    text-align: center;
    max-width: 900px;
    margin: 6px 0 14px;
    color: var(--muted-2);
}

.guess-input-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.guess-input-group {
    width: 100%;
    max-width: 420px;
}

@media (max-width: 768px) {
    .about-game {
        display: none !important;
    }

    .about-movie-grid {
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        max-width: 520px;
    }

    .about-title {
        margin-top: 18px;
        font-size: 1.6rem;
    }
}

.about-title {
    margin-top: 18px;
    font-size: 1.6rem;
}

/* ==========================================================
   ABOUT — SIGNATURE
   ========================================================== */
.about-signature {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--muted-2);
    margin-top: 80px;
    padding-bottom: 24px;
    text-align: center;
    opacity: 0.65;
    letter-spacing: 0.06em;
}

/* ==========================================================
   GUESS MODAL
   ========================================================== */
.guess-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.guess-modal-content {
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

.guess-modal-content img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.modal-close-btn {
    background: var(--lav);
    color: var(--ink);
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    transition: all 0.25s ease;
}

.guess-input-group .form-control {
    height: 48px;
    color: #fff !important;
    border-radius: 12px 0 0 12px;
    font-size: 1rem;
    background: #1c1c1c;
    border: 1px solid #333;
}

.guess-input-group .form-control::placeholder {
    color: #ccc !important;
    opacity: 1;
}

.guess-submit-btn {
    height: 48px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 0 12px 12px 0 !important;
    background: #1c1c1c;
    color: #ddd;
    border: 1px solid #333;
    transition: all 0.25s ease;
}

.guess-submit-btn:hover {
    background: var(--lav) !important;
    color: #000 !important;
}

.guess-page .about-title {
    margin-top: 24px;
    margin-bottom: 18px;
    color: var(--text);
    text-align: center;
}

/* ==========================================================
   UPLOAD CARD 
   ========================================================== */
.upload-card-desktop {
    background: var(--card);
    padding: 25px;
    border-radius: 14px;
    width: 90%;
    max-width: 350px;
    box-shadow:0 4px 20px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-title-desktop {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.4;
}

.upload-input-desktop {
    max-width: 100%;
}

.upload-btn-desktop,
.reset-btn-desktop {
    height: 48px;
    border-radius: 12px;
    font-weight: 800;
}

.upload-success-desktop {
    color: #4ADE80;
    margin-top: 10px;
    text-align: center;
}

.upload-error-desktop {
    color: #F97373;
    margin-top: 10px;
    text-align: center;
}

.watched-count-desktop {
    color: var(--muted-2);
    margin-top: 10px;
    text-align: center;
}

/* ==========================================================
   MOBILE MENU OVERLAY
   ========================================================== */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.mobile-menu-content {
    width: 80%;
    max-width: 320px;
    background: var(--card);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

.mobile-menu-link {
    display: block;
    padding: 14px 0;
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.25s ease;
}

.mobile-menu-link:hover {
    color: var(--lav);
}

.mobile-close-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--lav);
    color: var(--ink);
    border: none;
    border-radius: 8px;
    font-weight: bold;
}

/* ==========================================================
   HOME — DESKTOP TIGHTEN LAYOUT ADJUSTMENTS
   ========================================================== */
@media (min-width: 992px) {

  .home-grid {
    grid-template-columns: 1.4fr 0.9fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 14px;
    align-items: start;
    justify-items: stretch;
  }

  /* Place items explicitly */
  .home-pick  { grid-column: 1; grid-row: 1; }
  .home-movie { grid-column: 1; grid-row: 2; }
  .home-upload{
    grid-column: 2;
    grid-row: 2;
    align-self: start;      /* ✅ centers against movie-card row */
  }

  .movie-card {
    width: 100%;
    margin: 0;
  }

  .upload-card-desktop {
    width: 100%;
    max-width: 420px;
    margin-left: auto;       /* keep it on the right rail */
  }
}
