/* Golden Ace Casino - Integrated Modal Authentication Styles (FIXED) */

/* Modal Overlay - FORCED STYLES */
.auth-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    display: none !important; /* Hidden by default */
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important; /* INCREASED FROM 10000 */
    padding: 20px !important;
    animation: authModalFadeIn 0.3s ease;
}

.auth-modal-overlay.open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@keyframes authModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Container - Smaller with scroll */
.auth-modal-container {
    background: #16181D !important;
    border: 1px solid #2A2D35 !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 420px !important;
    max-height: 85vh !important;
    padding: 32px 28px !important;
    position: relative !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    animation: authModalSlideUp 0.4s ease;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 999999 !important; /* ADDED */
}

@keyframes authModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.auth-modal-container::-webkit-scrollbar {
    width: 8px;
}

.auth-modal-container::-webkit-scrollbar-track {
    background: #1A1D24;
    border-radius: 4px;
}

.auth-modal-container::-webkit-scrollbar-thumb {
    background: #2A2D35;
    border-radius: 4px;
}

.auth-modal-container::-webkit-scrollbar-thumb:hover {
    background: #3A3D45;
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #8B92A0;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.auth-modal-close:hover {
    background: #1F2329;
    color: #FFFFFF;
    transform: rotate(90deg);
}

/* Logo */
.auth-modal-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Tab Switcher */
.auth-tab-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #1A1D24;
    padding: 4px;
    border-radius: 12px;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #8B92A0;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

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

.auth-tab-btn.active {
    background: #22c55e;
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Form Container */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
    animation: authFormFadeIn 0.3s ease;
}

@keyframes authFormFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Groups */
.auth-form-group {
    margin-bottom: 16px;
}

.auth-form-group label {
    display: block;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.auth-form-group input {
    width: 100%;
    padding: 12px 14px;
    background: #1A1D24;
    border: 1px solid #2A2D35;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 13px;
    transition: all 0.3s;
    outline: none;
}

.auth-form-group input::placeholder {
    color: #8B92A0;
    font-size: 12px;
}

.auth-form-group input:focus {
    border-color: #FFC107;
    background: #1F2329;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

/* Form Options */
.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #8B92A0;
    font-size: 12px;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #FFC107;
}

.auth-checkbox-label span {
    user-select: none;
}

.auth-forgot-link,
.auth-link {
    color: #FFC107;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-forgot-link:hover,
.auth-link:hover {
    color: #F59E0B;
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

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

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.auth-btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-submit-btn.loading .auth-btn-text {
    opacity: 0;
}

.auth-submit-btn.loading .auth-btn-loader {
    display: inline-flex !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Messages */
.auth-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    animation: authMessageShake 0.5s;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

@keyframes authMessageShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px 0;
    color: #8B92A0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2A2D35;
}

.auth-divider span {
    padding: 0 12px;
}

/* Steam Button */
.auth-steam-btn {
    width: 100%;
    padding: 12px;
    background: #171a21;
    border: 1px solid #2a475e;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.auth-steam-btn:hover {
    background: #1b2838;
    border-color: #66c0f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 192, 244, 0.3);
}

.auth-steam-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-container {
        padding: 24px 20px;
        max-height: 90vh;
        max-width: 95%;
    }
    
    .auth-modal-logo {
        margin-bottom: 20px;
    }
    
    .auth-logo-image {
        height: 50px;
    }
    
    .auth-tab-switcher {
        margin-bottom: 20px;
    }
    
    .auth-tab-btn {
        padding: 9px 16px;
        font-size: 12px;
    }
    
    .auth-form-group {
        margin-bottom: 14px;
    }
    
    .auth-form-group label {
        font-size: 11px;
    }
    
    .auth-form-group input {
        padding: 11px 12px;
        font-size: 12px;
    }
    
    .auth-form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .auth-checkbox-label {
        font-size: 11px;
    }
    
    .auth-submit-btn {
        padding: 12px;
        font-size: 12px;
    }
    
    .auth-divider {
        margin: 16px 0 12px 0;
        font-size: 10px;
    }
    
    .auth-steam-btn {
        padding: 11px;
        font-size: 12px;
    }
}

@media (max-height: 700px) {
    .auth-modal-container {
        max-height: 95vh;
        padding: 24px 28px;
    }
    
    .auth-logo-image {
        height: 50px;
    }
    
    .auth-modal-logo {
        margin-bottom: 20px;
    }
    
    .auth-tab-switcher {
        margin-bottom: 20px;
    }
    
    .auth-form-group {
        margin-bottom: 14px;
    }
}

/* Smooth scrolling behavior */
.auth-modal-container {
    scroll-behavior: smooth;
}

/* DEBUG: Red border to see if modal exists */
.auth-modal-overlay[style*="flex"] {
    border: 5px solid red !important; /* TEMPORARY - REMOVE AFTER TESTING */
}

.auth-modal-container {
    border: 3px solid lime !important; /* TEMPORARY - REMOVE AFTER TESTING */
}