/* Theme Variables for ShotLogger Golf App */
/* Design Tokens - Colors, Spacing, Transitions */

:root {
    /* ==========================================================================
       LIGHT MODE DESIGN TOKENS
       ========================================================================== */
    
    /* Backgrounds */
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg-container: rgba(255, 255, 255, 0.95);
    --bg-section: rgba(248, 250, 252, 0.8);
    --bg-modal: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --bg-input: rgba(255, 255, 255, 0.9);
    --bg-hole-btn: rgba(255, 255, 255, 0.9);
    --bg-hole-btn-hover: rgba(239, 246, 255, 0.9);
    --surface-primary: #ffffff;
    --surface-secondary: #f8fafc;
    --surface-disabled: #f9fafb;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #374151;
    --text-tertiary: #64748b;
    --text-accent: #1e40af;
    --text-success: #047857;
    --text-success-bright: #059669;
    --text-success-values: #16a34a;
    
    /* Borders */
    --border-primary: rgba(148, 163, 184, 0.4);
    --border-secondary: #94a3b8;
    --border-accent: #1d4ed8;
    --border-success: rgba(5, 150, 105, 0.4);
    --border-color: #e5e7eb;
    
    /* Shadows */
    --shadow-primary: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-secondary: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Brand Colors */
    --primary-color: #3b82f6;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
    /* ==========================================================================
       DARK MODE DESIGN TOKENS
       ========================================================================== */
    
    /* Backgrounds */
    --bg-primary: linear-gradient(135deg, #0c1426 0%, #1e293b 100%);
    --bg-container: rgba(15, 23, 42, 0.95);
    --bg-section: rgba(30, 41, 59, 0.9);
    --bg-modal: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-input: rgba(15, 23, 42, 0.9);
    --bg-hole-btn: rgba(51, 65, 85, 0.9);
    --bg-hole-btn-hover: rgba(59, 130, 246, 0.3);
    --surface-primary: #1e293b;
    --surface-secondary: rgba(30, 41, 59, 0.6);
    --surface-disabled: rgba(30, 41, 59, 0.8);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #f8fafc;
    --text-tertiary: #e2e8f0;
    --text-accent: #60a5fa;
    --text-success: #6ee7b7;
    --text-success-bright: #34d399;
    --text-success-values: #22c55e;
    
    /* Borders */
    --border-primary: rgba(148, 163, 184, 0.4);
    --border-secondary: #64748b;
    --border-accent: #3b82f6;
    --border-success: rgba(16, 185, 129, 0.4);
    --border-color: #475569;
    
    /* Shadows */
    --shadow-primary: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-secondary: 0 4px 6px rgba(0, 0, 0, 0.5);
    
    /* Brand Colors */
    --primary-color: #60a5fa;
}

/* ==========================================================================
   Z-INDEX SCALE
   ========================================================================== */

:root {
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 1000;
    --z-modal: 2000;
    --z-modal-bag: 2500;
    --z-tooltip: 3000;
    --z-notification: 4000;
}

/* ==========================================================================
   GLOBAL UTILITIES
   ========================================================================== */

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    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: 0 !important;
}

/* Loading Animation */
@keyframes globalPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: globalPulse 2s infinite;
}

/* Global Slide Down Animation */
@keyframes globalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

.slide-down {
    animation: globalSlideDown 0.3s ease-out;
}

/* Button State Utilities */
.btn-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ==========================================================================
   GLOBAL TRANSITIONS
   ========================================================================== */

* {
    transition: 
        background-color var(--transition-normal),
        border-color var(--transition-normal),
        color var(--transition-normal),
        box-shadow var(--transition-normal),
        transform var(--transition-fast),
        opacity var(--transition-fast);
}

/* ==========================================================================
   ACCESSIBILITY - ALL APP MODULES
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, 
    *::before, 
    *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
    
    /* Disable specific animations from modules */
    .club-select-btn,
    .bag-action-btn,
    .my-bag-btn,
    .no-clubs-message,
    .shot-entry-modal.active .modal-content,
    .club-btn,
    .position-btn,
    .action-btn {
        transition: none !important;
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-primary: rgba(0, 0, 0, 0.8);
        --border-secondary: rgba(0, 0, 0, 0.6);
        --shadow-primary: 0 0 0 2px rgba(0, 0, 0, 0.8);
        --shadow-secondary: 0 0 0 1px rgba(0, 0, 0, 0.6);
    }
    
    [data-theme="dark"] {
        --border-primary: rgba(255, 255, 255, 0.8);
        --border-secondary: rgba(255, 255, 255, 0.6);
        --text-primary: #ffffff;
        --text-secondary: #ffffff;
        --text-tertiary: #f8fafc;
        --shadow-primary: 0 0 0 2px rgba(255, 255, 255, 0.8);
        --shadow-secondary: 0 0 0 1px rgba(255, 255, 255, 0.6);
    }
    
    /* High contrast overrides for modules */
    .info-section-header,
    .category-header {
        border: 2px solid currentColor !important;
    }
    
    .club-select-btn,
    .club-btn,
    .position-btn,
    .action-btn {
        border-width: 3px !important;
    }
    
    .club-select-btn.in-bag {
        background: #008000 !important;
        border-color: #004000 !important;
    }
}

/* ==========================================================================
   PRINT STYLES - ALL MODULES
   ========================================================================== */

@media print {
    .theme-toggle,
    .btn,
    .modal,
    .shot-entry-modal,
    #myBagModal,
    .my-bag-btn,
    .club-select-btn,
    .action-btn {
        display: none !important;
    }
    
    .app-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: white !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}