/* Firebase Auth Modal - Premium Black & Gold Theme */
/* Save this as: /css/firebase-auth-modals.css */

/* Import for animations */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Root variables for consistent theming */
:root {
    --gold-primary: #FFD700;
    --gold-dark: #FFA500;
    --gold-light: #FFF8DC;
    --black-primary: #000000;
    --black-secondary: #0A0A0A;
    --black-card: #141414;
    --gray-dark: #1F1F1F;
    --gray-medium: #2D2D2D;
    --gray-light: #888888;
}

/* Beautiful gradient backgrounds */
#enhancedLoginModal,
#enhancedRegisterModal,
#registrationPromptModal {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Modal content styling */
.modal-content {
    background: linear-gradient(145deg, var(--black-card) 0%, var(--black-secondary) 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.15),
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
}

/* Subtle golden glow effect */
.modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Premium input styling */
.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content input[type="tel"],
.modal-content input[type="date"],
.modal-content select {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid rgba(255, 215, 0, 0.2) !important;
    color: white !important;
    transition: all 0.3s ease !important;
    font-family: 'Inter', sans-serif !important;
}

/* Date input specific styling - MODERN LOOK */
.modal-content input[type="date"] {
    color-scheme: dark !important;
    cursor: pointer !important;
}

.modal-content input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.8) sepia(1) saturate(5) hue-rotate(45deg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) brightness(1) sepia(1) saturate(5) hue-rotate(45deg);
    transform: scale(1.1);
}

/* Placeholder text */
.modal-content input::placeholder {
    color: rgba(255, 215, 0, 0.4) !important;
}

/* When empty/not selected */
.modal-content input[type="date"]:invalid,
.modal-content input[type="date"]:not(:valid) {
    color: rgba(255, 215, 0, 0.5) !important;
}

/* Focus states with golden glow */
.modal-content input:focus,
.modal-content select:focus {
    border-color: var(--gold-primary) !important;
    box-shadow: 
        0 0 0 4px rgba(255, 215, 0, 0.1),
        0 0 20px rgba(255, 215, 0, 0.3) !important;
    outline: none !important;
}

/* Premium select styling */
.modal-content select {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

.modal-content select option {
    background: var(--black-primary) !important;
    color: var(--gold-primary) !important;
}

/* Beautiful button styling */
.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%) !important;
    color: var(--black-primary) !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4) !important;
}

/* Tab styling - Modern glassmorphism */
.modal-content .bg-gray-800 {
    background: rgba(255, 215, 0, 0.05) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    backdrop-filter: blur(10px) !important;
}

/* Active tab */
#emailTab.bg-gold-500,
#phoneTab.bg-gold-500,
#emailRegTab.bg-gold-500,
#phoneRegTab.bg-gold-500 {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark)) !important;
    color: var(--black-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
}

/* Inactive tab */
.text-gold-400 {
    color: rgba(255, 215, 0, 0.7) !important;
}

/* Labels with golden accent */
.modal-content label {
    color: var(--gold-primary) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.5px !important;
}

/* Icon styling */
.modal-content i {
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

/* Mobile Responsive Styles */
@media (max-width: 640px) {
    .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 1.5rem !important;
        overflow-y: auto !important;
        
        /* Safe area for notched devices */
        padding-top: env(safe-area-inset-top, 1.5rem) !important;
        padding-bottom: env(safe-area-inset-bottom, 1.5rem) !important;
    }
    
    /* Adjust icon and text sizes */
    .modal-content .w-16 {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }
    
    .modal-content h3 {
        font-size: 1.75rem !important;
    }
    
    /* Better input styling on mobile */
    .modal-content input,
    .modal-content select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Stack grid on mobile */
    .modal-content .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Full width buttons */
    .modal-content button {
        padding: 1rem !important;
        font-size: 1.125rem !important;
        border-radius: 12px !important;
    }
    
    /* Close button */
    .modal-content .absolute.top-4.right-4 {
        top: 1rem !important;
        right: 1rem !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 215, 0, 0.1) !important;
        border-radius: 50% !important;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .modal-content {
        padding: 1rem !important;
    }
    
    /* Stack tabs vertically */
    .modal-content .flex.mb-6 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    /* Smaller fonts */
    .modal-content h3 {
        font-size: 1.5rem !important;
    }
    
    .modal-content p {
        font-size: 0.875rem !important;
    }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    .modal-content {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
    
    /* Hide bounce animation */
    .animate-bounce {
        animation: none !important;
    }
    
    /* Reduce spacing */
    .mb-6 { margin-bottom: 1rem !important; }
    .mb-4 { margin-bottom: 0.75rem !important; }
}

/* Custom scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--gold-primary), var(--gold-dark));
    border-radius: 4px;
}

/* Loading state */
.modal-content input:disabled,
.modal-content button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Error state */
.modal-content input:invalid:not(:placeholder-shown) {
    border-color: #ff4444 !important;
}

/* Success animations */
@keyframes goldPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.gold-pulse {
    animation: goldPulse 2s infinite;
}

/* Modern glassmorphism for prompt modal */
#registrationPromptModal > div {
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 215, 0, 0.3) !important;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.2),
        0 25px 50px rgba(0, 0, 0, 0.7) !important;
}

/* Ensure proper z-indexing */
#enhancedLoginModal { z-index: 9998 !important; }
#enhancedRegisterModal { z-index: 9999 !important; }
#registrationPromptModal { z-index: 10000 !important; }