/**
 * Elder Spores Online - Authentication Module Styles
 * Handles login modal and auth-related UI
 * 
 * @version 1.0.0
 * @created 2025-12-09
 */

/* ========================================
   AUTH MODAL OVERLAY
   ======================================== */

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   AUTH MODAL CONTAINER
   ======================================== */

.auth-modal {
    background: linear-gradient(to bottom, var(--color-background) 25%, var(--color-secondary));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    box-shadow: 0 0 15px var(--color-primary);
    /* box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1); */
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0);
}

/* ========================================
   MODAL HEADER
   ======================================== */

.auth-modal-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.auth-logo {
    max-width: 210px;
    height: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.auth-modal-header h2 {
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   MODAL BODY
   ======================================== */

.auth-modal-body {
    padding: 24px 32px;
}

/* Benefits List */
.auth-benefits {
    margin-bottom: 24px;
}

.auth-benefits h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 12px 0;
}

.auth-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.benefit-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

/* ========================================
   DISCORD LOGIN BUTTON
   ======================================== */

.discord-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #5865F2;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.discord-login-btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.discord-login-btn:active {
    transform: translateY(0);
}

.discord-icon {
    flex-shrink: 0;
}

/* ========================================
   AUTH ERROR MESSAGE
   ======================================== */

.auth-error {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: #ff6b7a;
    font-size: 0.9rem;
    text-align: center;
}

.auth-error.visible {
    display: block;
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.auth-modal-footer {
    padding: 20px 32px 28px;
    border-top: 1px solid rgba(255, 215, 0, 0.15);
    text-align: center;
}

.auth-skip-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 24px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-skip-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.auth-note {
    margin: 12px 0 0 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* ========================================
   USER DISPLAY (Header Integration)
   ======================================== */

.user-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-display:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.user-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-tier-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.user-tier-badge.free {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.user-tier-badge.basic {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.user-tier-badge.premium {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.user-tier-badge.lifetime {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 107, 107, 0.3));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

/* Guest Display */
.guest-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guest-display:hover {
    background: rgba(88, 101, 242, 0.25);
    border-color: rgba(88, 101, 242, 0.5);
}

.guest-display span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* ========================================
   BODY STATE
   ======================================== */

body.modal-open {
    overflow: hidden;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 520px) {
    .auth-modal {
        width: 95%;
        margin: 16px;
    }
    
    .auth-modal-header,
    .auth-modal-body,
    .auth-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .auth-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .discord-login-btn {
        font-size: 1rem;
        padding: 12px 20px;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.discord-login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.discord-login-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}