/* ===== Authentication Modal Styles ===== */

/* ===== CSS Variables ===== */
:root {
    --auth-bg-1: #070B1A;
    --auth-bg-2: #0E1A3A;
    --auth-ink: #EAF2FF;
    --auth-accent: #64D4FF;
    --auth-gold: #F4D37E;
    --auth-error: #FF6B6B;
    --auth-success: #51CF66;
    --auth-font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

/* ===== Navbar Authentication Styles ===== */
.navbar__auth {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.auth-button {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-family: var(--auth-font);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.auth-button--primary {
    background: linear-gradient(135deg, var(--auth-accent) 0%, #4FACFE 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 212, 255, 0.3);
}

.auth-button--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--auth-ink);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.auth-button--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== User Menu ===== */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu.hidden {
    display: none;
}

.user-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(100, 212, 255, 0.5);
}

.user-avatar span {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 240px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(234, 242, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 16px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-menu.active .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-info {
    padding: 0 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.user-name {
    color: var(--auth-ink);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.user-email {
    color: rgba(234, 242, 255, 0.7);
    font-size: 14px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--auth-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--auth-accent);
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.logout-button:hover {
    color: var(--auth-error) !important;
}

/* ===== Responsive User Menu ===== */
@media (max-width: 768px) {
    .navbar__auth {
        gap: 12px;
    }
    
    .auth-button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .user-avatar span {
        font-size: 12px;
    }
    
    .user-menu-dropdown {
        min-width: 200px;
        right: -20px;
    }
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1000 !important;
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10000;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(234, 242, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
}

.auth-modal.active .auth-container {
    transform: translateY(0) scale(1);
}

.auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--ink);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== Form Container ===== */
.auth-form {
    padding: 40px 30px 30px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

.auth-form.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
}

/* ===== Header ===== */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(100, 212, 255, 0.5));
}

.auth-logo.success {
    filter: drop-shadow(0 0 15px rgba(244, 211, 126, 0.5));
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(100, 212, 255, 0.3);
}

.auth-header p {
    color: rgba(234, 242, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--ink);
    font-family: var(--font-stack);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(100, 212, 255, 0.2);
}

.form-group input::placeholder {
    color: rgba(234, 242, 255, 0.5);
}

/* ===== Password Toggle ===== */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    margin-top: 14px;
}

.password-toggle:hover {
    opacity: 1;
}

/* ===== Password Strength Indicator ===== */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.password-strength::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    transition: width 0.3s ease;
}

.password-strength.weak::after { width: 33%; background: #ef4444; }
.password-strength.medium::after { width: 66%; background: #f59e0b; }
.password-strength.strong::after { width: 100%; background: #10b981; }

/* ===== Form Options ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Custom Checkbox ===== */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(234, 242, 255, 0.9);
}

.checkbox-container input {
    width: auto !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

.checkmark {
    position: relative;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-container input:checked ~ .checkmark::after {
    opacity: 1;
}

/* ===== Buttons ===== */
.auth-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-stack);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(100, 212, 255, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(100, 212, 255, 0.4);
}

.auth-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.link-button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.link-button:hover {
    color: #0ea5e9;
}

/* ===== Divider ===== */
.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.auth-divider span {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(234, 242, 255, 0.08) 100%);
    padding: 0 15px;
    color: rgba(234, 242, 255, 0.7);
    font-size: 0.85rem;
    position: relative;
}

/* ===== User Menu (When Logged In) ===== */
.user-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(234, 242, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 20px;
    min-width: 250px;
    z-index: 1000;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.user-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.user-name {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.user-email {
    font-size: 0.85rem;
    color: rgba(234, 242, 255, 0.7);
    margin-bottom: 15px;
}

.user-menu-dropdown {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(234, 242, 255, 0.9);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-stack);
    font-size: 0.9rem;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink);
}

.menu-icon {
    font-size: 1.1rem;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px 0;
}

/* ===== Loading States ===== */
.auth-btn.loading {
    pointer-events: none;
}

.auth-btn.loading span {
    opacity: 0;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Error States ===== */
.form-group.error input {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

/* ===== Responsive Design ===== */
@media (max-width: 480px) {
    .auth-container {
        margin: 10px;
        max-width: none;
    }
    
    .auth-form {
        padding: 30px 20px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-menu {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}
