/* ═══════════════════════════════════════════
   AUTH.CSS  — shared styles loaded on every page
═══════════════════════════════════════════ */

/* ── RESET ── */
html {
    scrollbar-gutter: stable;
    /* Prevents page shaking when scrollbar appears */
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #050505;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ══════════════════════════════════════════
   AMBIENT BACKGROUND SYSTEM
   ══════════════════════════════════════════ */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0a0a14 0%, #050505 100%);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(123, 47, 247, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 47, 247, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 50% 50%, black, transparent 90%);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.1;
    pointer-events: none;
    animation: float 30s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: #7b2ff7;
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: #9f55ff;
    bottom: -300px;
    right: -200px;
    animation-duration: 40s;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: #4a00e0;
    top: 30%;
    right: 20%;
    opacity: 0.08;
    animation-duration: 50s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(20px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-10px, 10px) scale(0.95);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* ══════════════════════════════════════════
   MAIN NAV
══════════════════════════════════════════ */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    top: 20px;
    margin: 0 auto 40px;
    background: rgba(5, 5, 5, 0.3);
    backdrop-filter: blur(20px);
    z-index: 1000;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.main-nav:hover {
    transform: scale(1.03) translateY(-2px);
    background: rgba(10, 10, 15, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.main-nav .logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    text-decoration: none;
}

/* Nav links (middle section) */
.nav-links {
    display: flex;
    gap: 6px;
}

.nav-links a {
    text-decoration: none;
    color: #888;
    font-size: 14px;
    padding: 7px 14px;
    border-radius: 20px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: white;
    background: rgba(123, 47, 247, 0.12);
}

.nav-links a.nav-active {
    color: white;
    background: rgba(123, 47, 247, 0.2);
}

.nav-links a.nav-admin {
    color: #9f55ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-links a.nav-admin:hover,
.nav-links a.nav-admin.nav-active {
    background: rgba(123, 47, 247, 0.2);
}

/* Right section — username + profile dropdown */
.nav-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-username {
    font-size: 13px;
    color: #888;
}

.nav-profile-wrapper {
    position: relative;
}

.nav-profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-profile-icon:hover {
    color: white;
    background: rgba(123, 47, 247, 0.2);
    transform: scale(1.05);
}

/* ── PROFILE DROPDOWN ── */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 200px;
    background: rgba(12, 12, 21, 1);
    border: 1px solid rgba(123, 47, 247, 0.25);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 2000;

    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-dropdown-item:hover {
    background: rgba(123, 47, 247, 0.15);
    color: #fff;
    padding-left: 18px;
}

.profile-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.profile-dropdown-item:hover svg {
    opacity: 1;
}

.profile-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 8px;
}

.profile-dropdown-logout {
    color: #ff7c7c;
}

.profile-dropdown-logout:hover {
    background: rgba(220, 50, 50, 0.15);
    color: #ff9999;
}

/* ══════════════════════════════════════════
   SHARED BUTTON
══════════════════════════════════════════ */
.btn-primary {
    background: linear-gradient(135deg, #7b2ff7, #9f55ff);
    border: none;
    padding: 12px 26px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 15px;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8c46ff, #b37fff);
}


/* ══════════════════════════════════════════
   LOADER RING
══════════════════════════════════════════ */
.loader-ring {
    width: 44px;
    height: 44px;
    border: 4px solid #1a1a2e;
    border-top-color: #7b2ff7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════════
   AUTH MODAL
══════════════════════════════════════════ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-overlay.hidden {
    display: none;
}

.auth-modal {
    background: #0c0c15;
    border-radius: 20px;
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: modalIn 0.22s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.auth-close:hover {
    color: white;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-panel.hidden {
    display: none;
}

.auth-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 2px;
}

.auth-sub {
    color: #999;
    font-size: 14px;
    margin-bottom: 6px;
}

.auth-label {
    font-size: 13px;
    color: #ccc;
    margin-top: 4px;
}

.auth-hint {
    color: #777;
    font-size: 12px;
}

.auth-input {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 11px 14px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.auth-input:focus {
    border-color: #7b2ff7;
}

.auth-input::placeholder {
    color: #555;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
}

.auth-remember input {
    accent-color: #7b2ff7;
}

.auth-btn {
    margin-top: 6px;
    padding: 13px;
    background: linear-gradient(135deg, #7b2ff7, #9f55ff);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #8c46ff, #b37fff);
}

.auth-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.auth-link {
    color: #9f55ff;
    cursor: pointer;
    text-decoration: underline;
}

.auth-link:hover {
    color: #bf7fff;
}

.auth-error {
    background: rgba(220, 50, 50, 0.15);
    border: 1px solid rgba(220, 50, 50, 0.4);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #ff7c7c;
}

.auth-error.hidden {
    display: none;
}

/* ══════════════════════════════════════════
   UTILITY
══════════════════════════════════════════ */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════
   GLOBAL FOOTER
══════════════════════════════════════════ */
.main-footer {
    width: 100%;
    padding: 40px 8%;
    border-top: 1px solid rgba(123, 47, 247, 0.1);
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    margin-top: 100px;
}



.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff !important;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ══════════════════════════════════════════
   GOOGLE & OTP AUTH STYLING
   ══════════════════════════════════════════ */
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #202124;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #666;
    font-size: 12px;
    margin: 15px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #222;
}

.auth-divider:not(:empty)::before {
    margin-right: .5em;
}

.auth-divider:not(:empty)::after {
    margin-left: .5em;
}

.auth-tabs {
    display: flex;
    background: #151525;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 15px;
}

.auth-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #888;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.auth-tab-btn:hover {
    color: #fff;
}

.auth-tab-btn.active {
    background: #7b2ff7;
    color: #fff;
}

/* OTP Digit Inputs */
.otp-digits-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}

.otp-digit {
    width: 44px;
    height: 44px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 10px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.otp-digit:focus {
    border-color: #7b2ff7;
    box-shadow: 0 0 10px rgba(123, 47, 247, 0.4);
}

.otp-digit.success {
    border-color: #4cd98a !important;
    box-shadow: 0 0 10px rgba(76, 217, 138, 0.4) !important;
    background: rgba(76, 217, 138, 0.05) !important;
}

.otp-digit.error {
    border-color: #ff7c7c !important;
    box-shadow: 0 0 10px rgba(255, 124, 124, 0.4) !important;
    background: rgba(255, 124, 124, 0.05) !important;
}

/* ══════════════════════════════════════════
   MOBILE NAVBAR & DRAWER
══════════════════════════════════════════ */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.nav-mobile-drawer {
    display: none;
}

@media (max-width: 1024px) {

    /* Hide desktop nav links, user profile, and desktop login btn */
    .nav-links,
    .nav-user,
    .nav-login-btn {
        display: none !important;
    }

    /* Show hamburger */
    .nav-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Keep logo aligned left, adjust nav padding */
    .main-nav {
        padding: 10px 20px;
    }

    /* Mobile Drawer Base */
    .nav-mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen */
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        width: 0;
        max-width: 0;
        height: 100vh;
        background: linear-gradient(135deg, rgba(20, 15, 35, 0.96) 0%, rgba(10, 5, 20, 0.98) 100%);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        z-index: 3000;
        border-left: none;
        border-radius: 28px 0 0 28px;
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
        transition: right 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.5s, width 0.5s, padding 0.5s;
        padding: 0;
        overflow: hidden;
    }

    .nav-mobile-drawer.drawer-open {
        right: 0;
        transform: translateX(0);
        visibility: visible;
        pointer-events: all;
        width: 85vw;
        max-width: 340px;
        padding: 70px 24px 30px;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }

    .drawer-close-btn {
        position: absolute;
        top: 24px;
        right: 24px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #fff;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: 0.3s;
    }

    .drawer-close-btn:active {
        background: rgba(123, 47, 247, 0.3);
        transform: scale(0.95);
    }

    .drawer-links {
        display: flex;
        flex-direction: column;
        gap: 24px;
        margin-top: 10px;
        overflow-y: auto;
        padding-bottom: 20px;
        /* Hide scrollbar for Firefox */
        scrollbar-width: none;
        /* Hide scrollbar for IE/Edge */
        -ms-overflow-style: none;
    }

    /* Hide scrollbar for Chrome/Safari/Webkit */
    .drawer-links::-webkit-scrollbar {
        display: none;
    }

    .drawer-section {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .drawer-section-title {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: #8a8aa0;
        font-weight: 600;
        margin-bottom: 8px;
        padding-left: 12px;
    }

    .drawer-links a {
        text-decoration: none;
        color: #e2e8f0;
        font-size: 16px;
        font-weight: 500;
        padding: 12px;
        border-radius: 12px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
    }

    .drawer-links a:hover,
    .drawer-links a:active {
        background: rgba(255, 255, 255, 0.05);
        transform: translateX(4px);
    }

    .drawer-links a.active {
        color: #bf9bff;
        background: rgba(123, 47, 247, 0.1);
    }

    .drawer-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.06);
        margin: 10px 0;
    }

    .drawer-links .drawer-logout {
        color: #ff7c7c;
        margin-top: 5px;
    }

    .drawer-links .drawer-logout:hover,
    .drawer-links .drawer-logout:active {
        background: rgba(255, 124, 124, 0.1);
        color: #ff9999;
    }

    /* Hide footer links on mobile */
    .footer-links {
        display: none !important;
    }
}