/**
 * Event Staff Registration - Frontend Styles with Integrated Theme System
 * Version: 1.0.0
 * Author: Ayonto UG | ayonto.de
 * 
 * Features:
 * - Mobile-First responsive design
 * - Integrated theme system (7 themes including BlackWater)
 * - Dark mode support (auto + manual)
 * - CSS variables for easy customization
 * - WCAG 2.1 AAA accessibility
 * - Theme-independent design (overrides WordPress themes)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   ============================================ */

.esr-registration-form-wrapper {
    /* Primary Colors */
    --esr-primary: #2563eb;
    --esr-primary-hover: #1d4ed8;
    --esr-primary-light: #dbeafe;
    
    /* Accent Colors */
    --esr-accent: #0ea5e9;
    --esr-accent-hover: #0284c7;
    
    /* Success/Warning/Danger */
    --esr-success: #10b981;
    --esr-success-light: #d1fae5;
    --esr-warning: #f59e0b;
    --esr-warning-light: #fef3c7;
    --esr-danger: #ef4444;
    --esr-danger-light: #fee2e2;
    
    /* Neutral Colors (Light Mode) */
    --esr-background: #ffffff;
    --esr-background-alt: #f9fafb;
    --esr-surface: #ffffff;
    --esr-surface-hover: #f3f4f6;
    
    /* Text Colors (Light Mode) */
    --esr-text-primary: #111827;
    --esr-text-secondary: #6b7280;
    --esr-text-muted: #9ca3af;
    
    /* Border Colors */
    --esr-border: #e5e7eb;
    --esr-border-hover: #d1d5db;
    --esr-border-focus: var(--esr-primary);
    
    /* Shadows */
    --esr-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --esr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --esr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --esr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Typography */
    --esr-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --esr-font-size-base: 16px;
    --esr-font-size-sm: 14px;
    --esr-font-size-lg: 18px;
    --esr-font-size-xl: 20px;
    --esr-line-height: 1.5;
    
    /* Spacing */
    --esr-spacing-xs: 0.25rem;
    --esr-spacing-sm: 0.5rem;
    --esr-spacing-md: 1rem;
    --esr-spacing-lg: 1.5rem;
    --esr-spacing-xl: 2rem;
    --esr-spacing-2xl: 3rem;
    
    /* Border Radius */
    --esr-radius-sm: 0.25rem;
    --esr-radius: 0.5rem;
    --esr-radius-lg: 0.75rem;
    --esr-radius-xl: 1rem;
    
    /* Transitions */
    --esr-transition: all 0.2s ease-in-out;
    --esr-transition-fast: all 0.1s ease-in-out;
}

/* Dark Mode (Auto-detect) */
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper:not(.esr-force-light) {
        --esr-background: #111827;
        --esr-background-alt: #1f2937;
        --esr-surface: #1f2937;
        --esr-surface-hover: #374151;
        --esr-text-primary: #f9fafb;
        --esr-text-secondary: #d1d5db;
        --esr-text-muted: #9ca3af;
        --esr-border: #374151;
        --esr-border-hover: #4b5563;
        --esr-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --esr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --esr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --esr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    }
}

/* Force Dark Mode (Manual Toggle) */
.esr-registration-form-wrapper.esr-dark-mode {
    --esr-background: #111827;
    --esr-background-alt: #1f2937;
    --esr-surface: #1f2937;
    --esr-surface-hover: #374151;
    --esr-text-primary: #f9fafb;
    --esr-text-secondary: #d1d5db;
    --esr-text-muted: #9ca3af;
    --esr-border: #374151;
    --esr-border-hover: #4b5563;
    --esr-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --esr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --esr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --esr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* ============================================
   ACCENT THEMES
   ============================================ */

/* Ocean Theme (Default - Blue) */
.esr-registration-form-wrapper.esr-theme-ocean {
    --esr-primary: #2563eb;
    --esr-primary-hover: #1d4ed8;
    --esr-primary-light: #dbeafe;
    --esr-accent: #0ea5e9;
    --esr-accent-hover: #0284c7;
}

/* Forest Theme (Green) */
.esr-registration-form-wrapper.esr-theme-forest {
    --esr-primary: #059669;
    --esr-primary-hover: #047857;
    --esr-primary-light: #d1fae5;
    --esr-accent: #10b981;
    --esr-accent-hover: #059669;
}

/* Sunset Theme (Orange/Red) */
.esr-registration-form-wrapper.esr-theme-sunset {
    --esr-primary: #dc2626;
    --esr-primary-hover: #b91c1c;
    --esr-primary-light: #fee2e2;
    --esr-accent: #f97316;
    --esr-accent-hover: #ea580c;
}

/* Purple Theme */
.esr-registration-form-wrapper.esr-theme-purple {
    --esr-primary: #7c3aed;
    --esr-primary-hover: #6d28d9;
    --esr-primary-light: #ede9fe;
    --esr-accent: #a78bfa;
    --esr-accent-hover: #8b5cf6;
}

/* Pink Theme */
.esr-registration-form-wrapper.esr-theme-pink {
    --esr-primary: #db2777;
    --esr-primary-hover: #be185d;
    --esr-primary-light: #fce7f3;
    --esr-accent: #ec4899;
    --esr-accent-hover: #db2777;
}

/* Slate Theme (Professional Gray) */
.esr-registration-form-wrapper.esr-theme-slate {
    --esr-primary: #475569;
    --esr-primary-hover: #334155;
    --esr-primary-light: #e2e8f0;
    --esr-accent: #64748b;
    --esr-accent-hover: #475569;
}

/* ============================================
   BLACKWATER THEME
   Modern, high-contrast theme with signature red
   ============================================ */

/* BlackWater Theme - Bright Mode (Light) */
/* ============================================
   BLACKWATER THEME - BASED ON ACTUAL DESIGN
   ============================================ */

.esr-registration-form-wrapper.esr-theme-blackwater {
    /* Primary Colors */
    --esr-primary: #C2001E;
    --esr-primary-hover: #A00018;
    --esr-primary-light: #FFE5E8;
    
    /* Background Colors - Bright Mode (Like in Screenshot 2) */
    --esr-background: #F5F5F5;           /* Page background - light gray */
    --esr-surface: #FFFFFF;              /* Form container - pure white */
    --esr-surface-hover: #FAFAFA;
    
    /* Text Colors - Bright Mode */
    --esr-text-primary: #1A1A1A;
    --esr-text-secondary: #4A4A4A;
    --esr-text-muted: #7A7A7A;
    
    /* Border Colors */
    --esr-border: #D0D0D0;               /* Input borders */
    --esr-border-hover: #A0A0A0;
    --esr-border-focus: var(--esr-primary);
    
    /* Shadows - Subtle */
    --esr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --esr-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --esr-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --esr-radius: 8px;
}

/* BlackWater Theme - Dark Mode */
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode,
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) {
        /* Primary stays the same */
        --esr-primary: #C2001E;
        --esr-primary-hover: #E6001F;
        --esr-primary-light: #FFE5E8;
        
        /* Background Colors - Dark Mode (Like in Screenshot 1) */
        --esr-background: #0D0D0D;       /* Page background - very dark, almost black */
        --esr-surface: #2A2A2A;          /* Form container - medium dark gray */
        --esr-surface-hover: #353535;
        
        /* Text Colors - Dark Mode */
        --esr-text-primary: #FFFFFF;
        --esr-text-secondary: #D4D4D4;
        --esr-text-muted: #A0A0A0;
        
        /* Border Colors - Dark Mode */
        --esr-border: #4A4A4A;
        --esr-border-hover: #5A5A5A;
        --esr-border-focus: var(--esr-primary);
        
        /* Shadows - Dark Mode */
        --esr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --esr-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
        --esr-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
    }
}

/* BlackWater - Section Headings (Red Underline) */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-form-section h3 {
    border-bottom: 2px solid var(--esr-primary) !important;
    padding-bottom: 8px !important;
}

/* BlackWater - Input Focus (Red Glow) */
.esr-registration-form-wrapper.esr-theme-blackwater input:focus,
.esr-registration-form-wrapper.esr-theme-blackwater textarea:focus,
.esr-registration-form-wrapper.esr-theme-blackwater select:focus {
    border-color: var(--esr-primary) !important;
    box-shadow: 0 0 0 3px rgba(194, 0, 30, 0.15) !important;
}

/* BlackWater - Submit Button (FLAT RED, NO GRADIENT!) */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-submit-button {
    background: var(--esr-primary) !important;
    background-image: none !important; /* Remove any gradient! */
    border: none !important;
    box-shadow: none !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.esr-registration-form-wrapper.esr-theme-blackwater .esr-submit-button:hover {
    background: var(--esr-primary-hover) !important;
    background-image: none !important; /* Remove any gradient! */
    box-shadow: none !important;
    transform: none !important; /* No lift effect */
}

.esr-registration-form-wrapper.esr-theme-blackwater .esr-submit-button:active {
    background: #8A0015 !important;
    transform: scale(0.98) !important;
}

/* BlackWater - Selected Event (Pink Background + Red Border) */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-event-item.selected {
    background: linear-gradient(135deg, #FFC0CB 0%, #FFB6C1 100%) !important; /* Sanftes Rosa wie im Screenshot */
    border-color: var(--esr-primary) !important;
    border-width: 2px !important;
}

/* BlackWater Dark Mode - Selected Event */
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode .esr-event-item.selected,
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) .esr-event-item.selected {
        background: linear-gradient(135deg, #FFC0CB 0%, #FFB6C1 100%) !important; /* Same pink in dark mode */
        border-color: var(--esr-primary) !important;
    }
}

/* BlackWater - Event Items (White background when not selected) */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-event-item {
    background-color: #FFFFFF !important;
    border: 1px solid var(--esr-border) !important;
}

/* BlackWater Dark Mode - Event Items */
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode .esr-event-item,
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) .esr-event-item {
        background-color: #FFFFFF !important; /* Stay white even in dark mode for better contrast */
        color: #1A1A1A !important;
        border: 1px solid #E0E0E0 !important;
    }
}

/* BlackWater Dark Mode - Event Text Colors */
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode .esr-event-name,
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode .esr-event-date,
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode .esr-event-stats,
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) .esr-event-name,
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) .esr-event-date,
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) .esr-event-stats {
        color: #1A1A1A !important; /* Dark text on white cards */
    }
}

/* BlackWater - "Bedarf vorhanden" Text in Red */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-event-needed {
    color: var(--esr-primary) !important;
    font-weight: 600 !important;
}

/* BlackWater - Red Checkboxes */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-event-checkbox {
    accent-color: var(--esr-primary) !important;
    width: 22px !important;
    height: 22px !important;
}

/* BlackWater - Checkbox Consent */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-consent-checkbox {
    accent-color: var(--esr-primary) !important;
}

/* BlackWater - Input Fields (White in both modes) */
.esr-registration-form-wrapper.esr-theme-blackwater input,
.esr-registration-form-wrapper.esr-theme-blackwater textarea,
.esr-registration-form-wrapper.esr-theme-blackwater select {
    background-color: #FFFFFF !important;
    border: 1px solid var(--esr-border) !important;
    color: #1A1A1A !important;
}

/* BlackWater Dark Mode - Input Fields (Stay white) */
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode input,
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode textarea,
.esr-registration-form-wrapper.esr-theme-blackwater.esr-dark-mode select,
@media (prefers-color-scheme: dark) {
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) input,
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) textarea,
    .esr-registration-form-wrapper.esr-theme-blackwater:not(.esr-force-light) select {
        background-color: #FFFFFF !important;
        color: #1A1A1A !important;
        border: 1px solid #D0D0D0 !important;
    }
}
        background-color: #FFFFFF !important;
        color: #1A1A1A !important;
        border-color: #CCCCCC !important;
    }
}


/* ============================================
   BASE STYLES (MOBILE-FIRST)
   ============================================ */

.esr-registration-form-wrapper,
.esr-registration-form-wrapper * {
    box-sizing: border-box !important;
}

.esr-registration-form-wrapper {
    font-family: var(--esr-font-family) !important;
    font-size: var(--esr-font-size-base) !important;
    line-height: var(--esr-line-height) !important;
    color: var(--esr-text-primary) !important;
    background-color: var(--esr-surface) !important; /* FIXED: Use surface (white) not background (gray) */
    max-width: 800px;
    margin: var(--esr-spacing-lg) auto;
    padding: var(--esr-spacing-xl);
    border-radius: var(--esr-radius-lg);
    box-shadow: var(--esr-shadow-lg);
    position: relative;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.esr-registration-form-wrapper h1,
.esr-registration-form-wrapper h2,
.esr-registration-form-wrapper h3,
.esr-registration-form-wrapper h4,
.esr-registration-form-wrapper h5,
.esr-registration-form-wrapper h6 {
    font-family: var(--esr-font-family) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: var(--esr-text-primary) !important;
    margin: 0 0 var(--esr-spacing-md) 0 !important;
}

.esr-registration-form-wrapper h2 {
    font-size: 1.875rem !important;
    margin-bottom: var(--esr-spacing-lg) !important;
}

.esr-registration-form-wrapper h3 {
    font-size: 1.5rem !important;
}

.esr-registration-form-wrapper p {
    font-family: var(--esr-font-family) !important;
    font-size: var(--esr-font-size-base) !important;
    line-height: var(--esr-line-height) !important;
    color: var(--esr-text-secondary) !important;
    margin: 0 0 var(--esr-spacing-md) 0 !important;
}

/* ============================================
   MESSAGES
   ============================================ */

.esr-messages {
    margin-bottom: var(--esr-spacing-lg);
}

.esr-message {
    padding: var(--esr-spacing-md) var(--esr-spacing-lg) !important;
    border-radius: var(--esr-radius) !important;
    margin-bottom: var(--esr-spacing-md) !important;
    font-size: var(--esr-font-size-base) !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--esr-spacing-sm) !important;
    border-left: 4px solid !important;
}

.esr-message::before {
    font-size: 20px !important;
    flex-shrink: 0 !important;
}

.esr-message.success {
    background-color: var(--esr-success-light) !important;
    color: #065f46 !important;
    border-left-color: var(--esr-success) !important;
}

.esr-message.success::before {
    content: "✅" !important;
}

.esr-message.error {
    background-color: var(--esr-danger-light) !important;
    color: #991b1b !important;
    border-left-color: var(--esr-danger) !important;
}

.esr-message.error::before {
    content: "❌" !important;
}

/* ============================================
   FORM TITLE
   ============================================ */

.esr-form-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--esr-text-primary) !important;
    text-align: center !important;
    margin: 0 0 var(--esr-spacing-xl) 0 !important;
    padding-bottom: var(--esr-spacing-md) !important;
    border-bottom: 3px solid var(--esr-primary) !important;
}

/* BlackWater theme specific */
.esr-registration-form-wrapper.esr-theme-blackwater .esr-form-title {
    color: var(--esr-primary) !important;
}

/* Mobile */
@media (max-width: 767px) {
    .esr-form-title {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   FORM SECTIONS
   ============================================ */

.esr-form-section {
    margin-bottom: var(--esr-spacing-2xl) !important;
}

.esr-form-section:last-child {
    margin-bottom: 0 !important;
}

.esr-form-section h3 {
    font-size: var(--esr-font-size-xl) !important;
    font-weight: 700 !important;
    color: var(--esr-text-primary) !important;
    margin-bottom: var(--esr-spacing-lg) !important;
    padding-bottom: var(--esr-spacing-sm) !important;
    border-bottom: 2px solid var(--esr-border) !important;
}

/* ============================================
   FORM FIELDS (MOBILE-FIRST)
   ============================================ */

.esr-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--esr-spacing-lg);
    margin-bottom: var(--esr-spacing-lg);
}

.esr-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--esr-spacing-sm);
}

.esr-form-field label {
    font-family: var(--esr-font-family) !important;
    font-size: var(--esr-font-size-base) !important;
    font-weight: 600 !important;
    color: var(--esr-text-primary) !important;
    margin: 0 !important;
}

.esr-required {
    color: var(--esr-danger) !important;
    margin-left: var(--esr-spacing-xs) !important;
}

.esr-form-field input[type="text"],
.esr-form-field input[type="email"],
.esr-form-field input[type="tel"],
.esr-form-field textarea,
.esr-form-field select {
    font-family: var(--esr-font-family) !important;
    font-size: var(--esr-font-size-base) !important;
    line-height: var(--esr-line-height) !important;
    color: var(--esr-text-primary) !important;
    background-color: var(--esr-surface) !important;
    border: 2px solid var(--esr-border) !important;
    border-radius: var(--esr-radius) !important;
    padding: 12px 16px !important;
    min-height: 44px !important;
    width: 100% !important;
    transition: var(--esr-transition) !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.esr-form-field input:hover,
.esr-form-field textarea:hover,
.esr-form-field select:hover {
    border-color: var(--esr-border-hover) !important;
}

.esr-form-field input:focus,
.esr-form-field textarea:focus,
.esr-form-field select:focus {
    border-color: var(--esr-border-focus) !important;
    box-shadow: 0 0 0 3px var(--esr-primary-light) !important;
}

.esr-form-field textarea {
    min-height: 100px !important;
    resize: vertical !important;
}

.esr-form-field input::placeholder,
.esr-form-field textarea::placeholder {
    color: var(--esr-text-muted) !important;
    opacity: 1 !important;
}

/* ============================================
   EVENT SELECTION (MOBILE-FIRST)
   ============================================ */

.esr-events-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--esr-spacing-md) !important;
    margin-top: var(--esr-spacing-md) !important;
}

.esr-event-item {
    position: relative !important;
    background-color: var(--esr-surface) !important;
    border: 2px solid var(--esr-border) !important;
    border-radius: var(--esr-radius-lg) !important;
    padding: var(--esr-spacing-lg) !important;
    cursor: pointer !important;
    transition: var(--esr-transition) !important;
    display: flex !important;
    gap: var(--esr-spacing-md) !important;
}

.esr-event-item:hover {
    border-color: var(--esr-primary) !important;
    background-color: var(--esr-surface-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--esr-shadow-md) !important;
}

.esr-event-item.selected {
    border-color: var(--esr-primary) !important;
    background-color: var(--esr-primary-light) !important;
    box-shadow: var(--esr-shadow-md) !important;
}

.esr-event-checkbox {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    margin: 2px 0 0 0 !important;
    cursor: pointer !important;
    accent-color: var(--esr-primary) !important;
}

.esr-event-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.esr-event-name {
    font-size: var(--esr-font-size-lg) !important;
    font-weight: 600 !important;
    color: var(--esr-text-primary) !important;
    margin-bottom: var(--esr-spacing-xs) !important;
    word-wrap: break-word !important;
}

.esr-event-date {
    font-size: var(--esr-font-size-sm) !important;
    color: var(--esr-text-secondary) !important;
    margin-bottom: var(--esr-spacing-sm) !important;
}

.esr-event-stats {
    font-size: var(--esr-font-size-sm) !important;
    color: var(--esr-text-muted) !important;
}

/* ============================================
   HEATBOX (MOBILE-FIRST)
   ============================================ */

.esr-heat-bar {
    width: 100% !important;
    height: 8px !important;
    background-color: var(--esr-background-alt) !important;
    border-radius: var(--esr-radius) !important;
    overflow: hidden !important;
    margin-top: var(--esr-spacing-sm) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.esr-heat-fill {
    height: 100% !important;
    transition: width 0.5s ease-out, background-color 0.3s ease !important;
    border-radius: var(--esr-radius) !important;
}

/* 
 * HEATBOX COLORS ARE DEFINED IN ADMIN SETTINGS
 * Colors are set dynamically via inline styles from ESR_Admin_Settings
 * No hardcoded colors here to allow full customization through admin panel
 */

/* ============================================
   OVERBOOKING VISUALIZATION
   ============================================ */

.esr-heat-indicator {
    position: relative !important;
}

.esr-heat-indicator.esr-overbooked {
    padding-top: 28px !important;
}

.esr-overbooked-badge {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, #dc3545 0%, #c0392b 100%) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    animation: esr-pulse-badge 2s ease-in-out infinite !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Pulse animation for overbooked badge */
@keyframes esr-pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(220, 53, 69, 0.6);
    }
}

/* High overbooking (150%+) */
.esr-heat-bar.level-overbooked-high .esr-heat-fill {
    animation: esr-pulse-bar 1.5s ease-in-out infinite !important;
}

/* Extreme overbooking (200%+) */
.esr-heat-bar.level-overbooked-extreme .esr-heat-fill {
    animation: esr-pulse-bar-fast 1s ease-in-out infinite !important;
}

@keyframes esr-pulse-bar {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes esr-pulse-bar-fast {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.8;
        filter: brightness(1.2);
    }
}

/* Overbooked heat label styling */
.esr-overbooked .esr-heat-label {
    font-weight: 700 !important;
    color: var(--esr-danger) !important;
}

/* High/Extreme overbooked badge colors */
.esr-heat-indicator.esr-overbooked .level-overbooked-high + .esr-heat-label,
.esr-heat-indicator.esr-overbooked .level-overbooked-extreme + .esr-heat-label {
    animation: esr-text-pulse 2s ease-in-out infinite !important;
}

@keyframes esr-text-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   SUBMIT BUTTON (MOBILE-FIRST)
   ============================================ */

.esr-submit-button {
    font-family: var(--esr-font-family) !important;
    font-size: var(--esr-font-size-base) !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--esr-primary) 0%, var(--esr-accent) 100%) !important;
    border: none !important;
    border-radius: var(--esr-radius) !important;
    padding: var(--esr-spacing-md) var(--esr-spacing-xl) !important;
    cursor: pointer !important;
    transition: var(--esr-transition) !important;
    box-shadow: var(--esr-shadow) !important;
    width: 100% !important;
    min-height: 48px !important;
    text-align: center !important;
    margin-top: var(--esr-spacing-lg) !important;
}

.esr-submit-button:hover {
    background: linear-gradient(135deg, var(--esr-primary-hover) 0%, var(--esr-accent-hover) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--esr-shadow-md) !important;
}

.esr-submit-button:active {
    transform: translateY(0) !important;
    box-shadow: var(--esr-shadow-sm) !important;
}

.esr-submit-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ============================================
   DARK MODE TOGGLE
   ============================================ */

.esr-theme-toggle {
    position: absolute !important;
    top: var(--esr-spacing-md) !important;
    right: var(--esr-spacing-md) !important;
    background: var(--esr-surface) !important;
    border: 2px solid var(--esr-border) !important;
    border-radius: var(--esr-radius) !important;
    padding: var(--esr-spacing-sm) !important;
    cursor: pointer !important;
    transition: var(--esr-transition) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.esr-theme-toggle:hover {
    background: var(--esr-surface-hover) !important;
    border-color: var(--esr-border-hover) !important;
    transform: rotate(15deg) !important;
}

/* ============================================
   LOADING STATE
   ============================================ */

.esr-loading {
    position: relative !important;
    pointer-events: none !important;
    opacity: 0.6 !important;
}

.esr-loading::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 24px !important;
    height: 24px !important;
    margin: -12px 0 0 -12px !important;
    border: 3px solid var(--esr-primary) !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: esr-spin 0.8s linear infinite !important;
}

@keyframes esr-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.esr-registration-form-wrapper *:focus-visible {
    outline: 2px solid var(--esr-primary) !important;
    outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
    .esr-registration-form-wrapper,
    .esr-registration-form-wrapper * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.esr-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* ============================================
   RESPONSIVE (DESKTOP ENHANCEMENTS)
   ============================================ */

@media (min-width: 640px) {
    .esr-registration-form-wrapper {
        margin: var(--esr-spacing-2xl) auto;
        padding: var(--esr-spacing-2xl);
    }
    
    .esr-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .esr-events-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .esr-submit-button {
        width: auto !important;
        min-width: 200px !important;
    }
}

@media (min-width: 1024px) {
    .esr-events-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .esr-registration-form-wrapper {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .esr-submit-button,
    .esr-theme-toggle {
        display: none !important;
    }
}
