:root {
    /* Light Theme - Improved Visibility */
    --bg-color: #ffffff;
    --text-color: #202124;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e8eaed;
    --card-bg: #ffffff;
    --blob-1: rgba(26, 115, 232, 0.35); /* Increased opacity */
    --blob-2: rgba(52, 168, 83, 0.3);
    --blob-3: rgba(147, 51, 234, 0.3);
    --primary-btn: #1a73e8;
    --hero-gradient: linear-gradient(135deg, #1a73e8, #34a853);
    --bg-gradient: radial-gradient(circle at 50% 50%, #ffffff, #f0f4ff);
}

body.dark-theme {
    /* Dark Theme - "Fosfir" Vibe */
    --bg-color: #0b0e14;
    --text-color: #e8eaed;
    --navbar-bg: rgba(11, 14, 20, 0.9);
    --border-color: #2a2e37;
    --card-bg: #161b22;
    --blob-1: rgba(0, 255, 255, 0.45); /* More neon */
    --blob-2: rgba(0, 255, 127, 0.4);
    --blob-3: rgba(255, 0, 255, 0.4);
    --primary-btn: #00d2ff;
    --hero-gradient: linear-gradient(135deg, #00d2ff, #2bff88);
    --bg-gradient: radial-gradient(circle at 50% 50%, #0b0e14, #05070a);
}

/* ═══ BASE ═══ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── ANIMATED BACKGROUND ── */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-gradient);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    transition: transform 0.1s ease-out;
    pointer-events: none;
    mix-blend-mode: multiply; /* Better visibility on light background */
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--blob-1);
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--blob-2);
    bottom: -100px;
    left: -100px;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: var(--blob-3);
    top: 40%;
    left: 30%;
}

body.dark-theme .blob {
    filter: blur(100px);
    opacity: 0.6;
    mix-blend-mode: screen;
}

.gradient-text {
    background: var(--hero-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ NAVBAR ═══ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 40px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
}

body.dark-theme .fa-moon { display: none; }
body:not(.dark-theme) .fa-sun { display: none; }

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.logo-text {
    font-size: 20px;
    color: #202124;
    font-weight: 400;
    letter-spacing: -.3px;
}

.logo-text strong {
    font-weight: 700;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.btn-logout {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    margin-left: 4px;
    transition: color .2s;
    display: flex;
    align-items: center;
}

.btn-logout:hover {
    color: #ea4335;
}

/* ═══ BUTTONS ═══ */
.btn-text {
    background: none;
    border: none;
    color: var(--primary-btn);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background .2s;
}

.btn-text:hover {
    background: rgba(26, 115, 232, 0.1);
}

.btn-primary-sm {
    background: var(--primary-btn);
    color: #000; /* Dark text on neon button or white on blue */
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}

body:not(.dark-theme) .btn-primary-sm {
    color: white;
}

.btn-primary-sm:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px var(--primary-btn);
}

.btn-primary-lg {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-btn);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    white-space: nowrap;
}

body:not(.dark-theme) .btn-primary-lg {
    color: white;
}

.btn-primary-lg:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-btn);
}

.btn-primary-lg:active {
    transform: translateY(0);
}

/* ── Random Chat buttons ─────────────────── */
.btn-random-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(147, 51, 234, .12), rgba(26, 115, 232, .12));
    color: #7c3aed;
    border: 1px solid rgba(147, 51, 234, .25);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.btn-random-nav:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, .22), rgba(26, 115, 232, .22));
    border-color: rgba(147, 51, 234, .5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, .2);
}

.btn-random-lg {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--hero-gradient);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
    box-shadow: 0 4px 16px var(--blob-1);
}

.btn-random-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--blob-1);
    filter: brightness(1.1);
}

.btn-random-lg:active {
    transform: translateY(0);
}


.btn-google-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}

.btn-google-hero:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
}

.btn-google-hero img {
    width: 20px;
    height: 20px;
}

/* ═══ HERO ═══ */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 80px 80px 60px;
    max-width: 1300px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 560px;
}

.hero-title {
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.7;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.join-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.join-form input {
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 14px;
    width: 240px;
    background: transparent;
    color: var(--text-color);
}

.join-form input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.btn-join {
    background: none;
    border: none;
    padding: 12px 20px;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

.btn-join:hover {
    background: #e8f0fe;
}

/* ═══ HERO VISUAL ═══ */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    max-width: 440px;
    width: 100%;
}

.preview-card {
    border-radius: 16px;
    overflow: hidden;
    background: #202124;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    min-height: 120px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    transition: transform .2s;
}

.preview-card:hover {
    transform: scale(1.02);
}

.main-card {
    grid-column: 1/3;
    min-height: 180px;
}

.preview-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.main-card .preview-avatar {
    width: 90px;
    height: 90px;
    font-size: 36px;
}

.preview-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.preview-controls {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.preview-controls span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

/* ═══ FEATURES ═══ */
.features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 40px 40px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 24px;
    width: 220px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    transition: transform .2s, box-shadow .2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    border-color: var(--primary-btn);
}

body.dark-theme .feature-card:hover {
    box-shadow: 0 0 20px var(--blob-1);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 14px;
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #202124;
}

.feature-card p {
    font-size: 13px;
    color: #5f6368;
    line-height: 1.5;
}

/* ═══ MODALS ═══ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    z-index: 300;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: min(420px, 92vw);
    box-shadow: 0 12px 48px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .3s;
}

.modal.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%);
}

.link-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    z-index: 301;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: min(440px, 92vw);
    box-shadow: 0 12px 48px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .3s;
}

.link-modal.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.modal-close:hover {
    background: #f1f3f4;
}

.modal-body {
    padding: 16px 24px 24px;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    text-align: left;
    margin-bottom: 10px;
    transition: border-color .2s, background .2s;
    color: var(--text-color);
}

.modal-option:hover {
    border-color: var(--primary-btn);
    background: var(--border-color);
}

.modal-option:last-child {
    margin-bottom: 0;
}

.option-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
}

.option-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.option-text span {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
}

.option-arrow {
    color: #9aa0a6;
    font-size: 13px;
}

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
}

.link-box span {
    flex: 1;
    font-size: 13px;
    color: var(--text-color);
    word-break: break-all;
}

.copy-btn {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}

.copy-btn:hover {
    background: #1557b0;
}

/* ═══ RESPONSIVE ═══ */
/* ── Auth Related ── */
.user-info-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
    background: #f1f3f4;
    border-radius: 100px;
    margin-right: 8px;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-avatar-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout-small {
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
    display: flex;
    align-items: center;
}

.btn-logout-small:hover {
    color: #ea4335;
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
    }

    .hero {
        padding: 40px 20px;
        flex-direction: column;
        text-align: center;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .join-form {
        width: 100%;
        max-width: 320px;
    }

    .hero-visual {
        display: none;
    }

    .user-info-nav {
        margin-right: 0;
    }

    .nav-user-name {
        display: none;
    }
}

@media(max-width:900px) {
    .hero {
        flex-direction: column;
        padding: 50px 24px 40px;
        text-align: center;
        min-height: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    .navbar {
        padding: 12px 20px;
    }

    .features {
        padding: 20px 16px 40px;
    }

    .feature-card {
        width: calc(50% - 10px);
    }
}

@media(max-width:520px) {
    .join-form {
        width: 100%;
    }

    .join-form input {
        width: 100%;
    }

    .feature-card {
        width: 100%;
    }

    .hero-title {
        font-size: 32px;
    }
}