/* auth/css/auth.css */
:root {
    --auth-primary: #2563eb; 
    --auth-text: #1f2937;
    --auth-bg: #f3f4f6;
    --auth-card: #ffffff;
    --auth-error: #ef4444;
}

/* Scoped to login wrapper to prevent affecting the rest of the site */
.login-body-wrapper {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: var(--auth-bg);
}

.login-body-wrapper.transparent {
    background-color: transparent !important;
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed;
    top: 0;
    left: 0;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

/* =========================================
   ADVANCED 4-LAYER LIQUID GLASS ARCHITECTURE
   ========================================= */
.login-container.liquidGlass-wrapper {
    position: relative;
    overflow: hidden;
    padding: 45px 40px;
    border-radius: 40px; /* Highly rounded */
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
    /* Remove base background so layers handle it */
    background: transparent;
    border: none;
    will-change: transform;
    -webkit-transform: translateZ(0); /* Hardware accelerate */
    transform: translateZ(0);
    
    /* Slight liquid zoom-in animation on load */
    animation: liquidPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(0.9);
    opacity: 0;
}

.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* Note: SVG filter #liquid-filter-main is applied to the full screen overlay, 
       so we just blur the box itself here */
    border-radius: inherit;
    overflow: hidden;
    will-change: backdrop-filter;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.liquidGlass-tint {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(255, 255, 255, 0.65); /* Frosted white tint */
    border-radius: inherit;
}

.liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    border-radius: inherit;
    box-shadow: 
        inset 2px 2px 2px 0 rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px 1px rgba(255, 255, 255, 0.4),
        /* Chromatic Aberration Edges */
        inset -3px 0 5px rgba(255, 0, 0, 0.2),
        inset 3px 0 5px rgba(0, 0, 255, 0.2);
}

.liquidGlass-content {
    position: relative;
    z-index: 3;
    color: #fff;
}

@keyframes liquidPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    50% { transform: scale(1.02) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.logo-container {
    margin-bottom: 24px;
}

.logo {
    max-width: 150px;
    height: auto;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 8px;
    margin-top: 0;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 32px;
}

.google-btn-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.error-message {
    background-color: #fee2e2;
    color: var(--auth-error);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fca5a5;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Auth Profile UI for standard pages */
.auth-profile-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.auth-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.auth-profile-trigger:hover {
    background: #f3f4f6;
}

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

.auth-profile-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.auth-dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

.auth-dropdown-menu.show {
    display: block;
}

.auth-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.auth-dropdown-email {
    font-size: 12px;
    color: #6b7280;
    word-break: break-all;
}

.auth-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.auth-dropdown-item:hover {
    background: #f3f4f6;
}

.auth-logout {
    color: var(--auth-error) !important;
    border-top: 1px solid #e5e7eb;
}

/* Auth Nav Item Overrides */
.nav-links .auth-nav-item {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.nav-links .auth-nav-item a {
    text-transform: none;
    letter-spacing: normal;
}

.nav-links .auth-nav-item a::after {
    display: none !important; /* Disable the sliding underline */
}

/* Professional Animated Sign In Button */
.auth-signin-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white !important;
    padding: 10px 24px !important;
    border-radius: 50px;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.auth-signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.auth-signin-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

/* =========================================
   NAVBAR POSITIONING OVERRIDES
   ========================================= */
/* Ensure the flex container can re-order its children */
.nav-container {
    display: flex;
    align-items: center;
}

.logo {
    order: 1;
    margin-right: auto;
}

.nav-links {
    order: 2;
}

#auth-container {
    order: 3;
    margin-left: 20px;
}

.mobile-menu-btn {
    order: 4;
}

@media (max-width: 768px) {
    #auth-container {
        order: 2;
        margin-left: auto;
        margin-right: 15px;
    }
    .mobile-menu-btn {
        order: 3;
    }
}

/* =========================================
   PROFILE MODULE CSS
   ========================================= */
/* Profile Icon Trigger */
.auth-menu-wrapper {
    position: relative;
    display: inline-block;
}

.auth-profile-trigger-icon {
    background: transparent;
    border: 2px solid transparent;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-profile-trigger-icon:hover, .auth-dropdown-menu.show ~ .auth-profile-trigger-icon {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.auth-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

/* User Info Header in Dropdown */
.auth-user-info-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 5px;
    background: #f9fafb;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.auth-user-name {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    line-height: 1.2;
}

.auth-user-email {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Animated Logout Button */
.auth-logout-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px !important;
    color: #ef4444 !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: transparent;
    text-decoration: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.auth-logout-icon {
    margin-right: 10px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.auth-logout-btn:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    padding-left: 24px !important;
}

.auth-logout-btn:hover .auth-logout-icon {
    transform: translateX(4px) scale(1.2);
}

.auth-dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 10px;
    right: 0;
    left: auto;
    background-color: white;
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    min-width: 240px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    /* Animation hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s ease;
    z-index: 1000;
}

.auth-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
