/* ============================================
   🔐 AUTH STYLES - PokéVault
   ============================================ */

/* --- AUTH MODAL --- */
#auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal-content {
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(167, 139, 250, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-modal-header h2 {
    font-family: 'Righteous', cursive;
    font-size: 28px;
    color: #fff;
    margin: 0 0 8px 0;
}

.auth-modal-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* --- FORM INPUTS --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-input-group label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-input {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.auth-input::placeholder {
    color: #666;
}

/* --- ERROR MESSAGE --- */
.auth-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #ef4444;
    font-size: 13px;
    text-align: center;
}

/* --- BUTTONS --- */
.auth-submit-btn {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.3);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* --- SWITCH MODE LINK --- */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-switch span {
    color: #888;
    font-size: 14px;
}

.auth-switch-link {
    color: #a78bfa;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-left: 5px;
    transition: color 0.2s;
}

.auth-switch-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* --- HEADER AUTH BUTTONS --- */
.auth-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
}

.auth-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#auth-login-btn {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(99, 102, 241, 0.2));
    border-color: rgba(167, 139, 250, 0.3);
    color: #a78bfa;
}

#auth-login-btn:hover {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(99, 102, 241, 0.3));
}

#auth-logout-btn {
    display: none;
    color: #888;
}

#auth-logout-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

#auth-user-display {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 8px;
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
}

#auth-user-display::before {
    content: '👤';
}

#auth-guest-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #666;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* --- LOADING OVERLAY --- */
#data-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-message {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

/* --- RESPONSIVE --- */
@media (max-width: 767px) {
    .auth-modal-content {
        margin: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .auth-header-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    #auth-user-display {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide auth buttons on mobile - they go in settings/more menu */
    #auth-login-btn,
    #auth-logout-btn,
    #auth-guest-badge,
    #auth-user-display {
        display: none !important;
    }
}

/* --- GUEST PLAY INFO --- */
.auth-guest-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: 8px;
    text-align: center;
}

.auth-guest-info p {
    color: #ffd93d;
    font-size: 12px;
    margin: 0;
}

.auth-guest-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-guest-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}