/**
 * Aviation Theme CSS Enhancements for Aviate Logbook
 *
 * Light Theme: "Horizon Day" - Clear skies and cockpit instruments
 * Dark Theme: "Night Flight" - Cockpit instruments at night with glowing indicators
 */

/* ============================================
   CSS Custom Properties - Aviation Color System
   ============================================ */

:root {
    /* Light Theme - Horizon Day */
    --aviation-primary: #0D47A1;
    --aviation-secondary: #FF8F00;
    --aviation-tertiary: #00838F;
    --aviation-success: #2E7D32;
    --aviation-warning: #F9A825;
    --aviation-error: #C62828;
    --aviation-info: #0288D1;

    /* Light surfaces */
    --aviation-appbar: #0D47A1;
    --aviation-drawer: #263238;
    --aviation-background: #F5F7FA;
    --aviation-surface: #FFFFFF;

    /* Typography */
    --aviation-font-primary: 'IBM Plex Sans', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --aviation-font-mono: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace;
}

/* Dark Theme overrides */
.mud-theme-dark,
[data-theme="dark"] {
    --aviation-primary: #64B5F6;
    --aviation-secondary: #FFB300;
    --aviation-tertiary: #26C6DA;
    --aviation-success: #4CAF50;
    --aviation-warning: #FFC107;
    --aviation-error: #EF5350;
    --aviation-info: #29B6F6;

    /* Dark surfaces */
    --aviation-appbar: #12121E;
    --aviation-drawer: #16162A;
    --aviation-background: #0E0E1A;
    --aviation-surface: #1A1A2E;
}

/* ============================================
   Dark Mode Glow Effects
   ============================================ */

/* Glowing interactive elements in dark mode */
.mud-theme-dark .mud-button-filled-primary,
.mud-theme-dark .mud-button-outlined-primary:hover {
    box-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
}

.mud-theme-dark .mud-button-filled-secondary,
.mud-theme-dark .mud-button-outlined-secondary:hover {
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.3);
}

.mud-theme-dark .mud-button-filled-tertiary,
.mud-theme-dark .mud-button-outlined-tertiary:hover {
    box-shadow: 0 0 20px rgba(38, 198, 218, 0.3);
}

/* Primary icon glow in dark mode */
.mud-theme-dark .mud-icon-root.mud-primary-text {
    filter: drop-shadow(0 0 4px rgba(100, 181, 246, 0.5));
}

/* ============================================
   Card Styling - Instrument Panel Aesthetic
   ============================================ */

/* Card with instrument panel feel */
.mud-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.mud-theme-dark .mud-card {
    background: linear-gradient(145deg, var(--aviation-surface), rgba(26, 26, 46, 0.8));
    border: 1px solid rgba(100, 181, 246, 0.1);
}

.mud-theme-dark .mud-card:hover {
    border-color: rgba(100, 181, 246, 0.2);
}

/* Card with status indicator border (for currency cards) */
.aviation-card-status {
    position: relative;
    border-left-width: 4px;
    border-left-style: solid;
}

.aviation-card-status.status-current {
    border-left-color: var(--aviation-success);
}

.aviation-card-status.status-warning {
    border-left-color: var(--aviation-warning);
}

.aviation-card-status.status-expired {
    border-left-color: var(--aviation-error);
    animation: beacon-pulse 2s infinite;
}

/* Beacon pulse animation for expired status */
@keyframes beacon-pulse {
    0%, 100% {
        border-left-color: var(--aviation-error);
    }
    50% {
        border-left-color: rgba(239, 83, 80, 0.5);
    }
}

/* ============================================
   DataGrid Styling - Aviation Headers
   ============================================ */

/* DataGrid header styling */
.mud-table-head .mud-table-cell {
    font-family: var(--aviation-font-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.mud-theme-dark .mud-table-head .mud-table-cell {
    background: linear-gradient(180deg, rgba(37, 37, 66, 1) 0%, rgba(26, 26, 46, 1) 100%);
}

/* Flight data cells - use monospace for numbers */
.mud-table-cell .flight-time,
.mud-table-cell .flight-altitude,
.mud-table-cell .flight-duration,
.mud-table-cell .icao-code {
    font-family: var(--aviation-font-mono);
    font-size: 0.875rem;
}

/* ============================================
   Form Input Styling - Instrument Display
   ============================================ */

/* Input focus glow in dark mode */
.mud-theme-dark .mud-input-outlined.mud-input-outlined-focused .mud-input-outlined-border {
    border-color: var(--aviation-primary);
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.3);
}

.mud-theme-dark .mud-input-filled.mud-input-focused {
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.3);
}

/* Number inputs with instrument display feel */
.mud-theme-dark input[type="number"],
.mud-theme-dark .mud-numericfield input {
    font-family: var(--aviation-font-mono);
}

/* ============================================
   Progress Indicators - Attitude Indicator
   ============================================ */

/* Linear progress with aviation styling */
.mud-progress-linear .mud-progress-linear-bar {
    background: linear-gradient(90deg, var(--aviation-tertiary), var(--aviation-primary));
}

.mud-theme-dark .mud-progress-linear .mud-progress-linear-bar {
    background: linear-gradient(90deg, #26C6DA, #64B5F6);
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.5);
}

/* Circular progress with glow */
.mud-theme-dark .mud-progress-circular-svg circle {
    filter: drop-shadow(0 0 4px currentColor);
}

/* ============================================
   Currency Status Indicators
   ============================================ */

.currency-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.currency-indicator.current {
    background-color: rgba(46, 125, 50, 0.15);
    color: var(--aviation-success);
}

.mud-theme-dark .currency-indicator.current {
    background-color: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.currency-indicator.warning {
    background-color: rgba(249, 168, 37, 0.15);
    color: var(--aviation-warning);
}

.mud-theme-dark .currency-indicator.warning {
    background-color: rgba(255, 193, 7, 0.2);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.currency-indicator.expired {
    background-color: rgba(198, 40, 40, 0.15);
    color: var(--aviation-error);
}

.mud-theme-dark .currency-indicator.expired {
    background-color: rgba(239, 83, 80, 0.2);
    box-shadow: 0 0 8px rgba(239, 83, 80, 0.3);
    animation: glow-pulse 1.5s infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 83, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(239, 83, 80, 0.5);
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--aviation-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--aviation-primary);
}

.mud-theme-dark ::-webkit-scrollbar-thumb {
    background: rgba(38, 198, 218, 0.5);
}

.mud-theme-dark ::-webkit-scrollbar-thumb:hover {
    background: var(--aviation-tertiary);
}

/* ============================================
   Button Enhancements
   ============================================ */

/* Buttons with depth gradients */
.mud-button-filled {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.mud-theme-dark .mud-button-filled {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.15) 100%);
}

/* Icon button hover effects */
.mud-icon-button:hover {
    transform: scale(1.05);
}

.mud-theme-dark .mud-icon-button:hover {
    box-shadow: 0 0 12px rgba(100, 181, 246, 0.4);
}

/* ============================================
   Navigation Styling
   ============================================ */

/* Drawer navigation items */
.mud-nav-link {
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.mud-nav-link:hover {
    background-color: rgba(100, 181, 246, 0.1);
}

.mud-theme-dark .mud-nav-link.mud-nav-link-active {
    background: linear-gradient(90deg, rgba(100, 181, 246, 0.2), transparent);
    border-left: 3px solid var(--aviation-primary);
}

/* ============================================
   Tooltip and Popover
   ============================================ */

.mud-theme-dark .mud-tooltip {
    background: var(--aviation-surface);
    border: 1px solid rgba(100, 181, 246, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Snackbar Enhancements
   ============================================ */

.mud-theme-dark .mud-snackbar {
    background: var(--aviation-surface);
    border: 1px solid rgba(100, 181, 246, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.mud-theme-dark .mud-snackbar.mud-snackbar-success {
    border-color: rgba(76, 175, 80, 0.5);
}

.mud-theme-dark .mud-snackbar.mud-snackbar-warning {
    border-color: rgba(255, 193, 7, 0.5);
}

.mud-theme-dark .mud-snackbar.mud-snackbar-error {
    border-color: rgba(239, 83, 80, 0.5);
}

/* ============================================
   Statistics Cards
   ============================================ */

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--aviation-primary), var(--aviation-tertiary));
}

.mud-theme-dark .stat-card::before {
    background: linear-gradient(90deg, #64B5F6, #26C6DA);
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.5);
}

.stat-value {
    font-family: var(--aviation-font-mono);
    font-size: 1.75rem;
    font-weight: 700;
}

.mud-theme-dark .stat-value {
    text-shadow: 0 0 10px currentColor;
}

/* ============================================
   Hero Section (Landing Page)
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, #0D47A1 0%, #00838F 100%);
    color: white;
    padding: 4rem 0;
}

.mud-theme-dark .hero-section {
    background: linear-gradient(135deg, #0D47A1 0%, #006064 50%, #004D40 100%);
}

/* ============================================
   Landing Page CTA Section
   ============================================ */

.cta-section {
    background: linear-gradient(135deg, #0D47A1 0%, #00838F 100%);
}

.mud-theme-dark .cta-section {
    background: linear-gradient(135deg, #0D47A1 0%, #006064 50%, #004D40 100%);
}

/* ============================================
   Pricing Card Enhancements
   ============================================ */

.pricing-card.featured {
    border-color: var(--aviation-primary) !important;
}

.pricing-card.featured::before {
    background: var(--aviation-primary) !important;
}

.mud-theme-dark .pricing-card.featured {
    border-color: var(--aviation-tertiary) !important;
    box-shadow: 0 0 30px rgba(38, 198, 218, 0.3);
}

.mud-theme-dark .pricing-card.featured::before {
    background: var(--aviation-tertiary) !important;
}

/* ============================================
   Print Styles - PDF Export
   ============================================ */

@media print {
    /* Hide navigation elements */
    .mud-drawer,
    .mud-appbar,
    .mud-navmenu,
    .no-print {
        display: none !important;
    }

    /* Reset background colors for printing */
    body,
    .mud-main-content,
    .mud-container {
        background: white !important;
        color: black !important;
    }

    /* Remove shadows and glows */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
    }

    /* Ensure content fills page */
    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Mobile-friendly touch targets */
@media (max-width: 768px) {
    .mud-button {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Larger stat values on mobile */
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   Flight Data Display Utilities
   ============================================ */

/* Monospace for ICAO codes, times, altitudes */
.flight-code {
    font-family: var(--aviation-font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.flight-time-display {
    font-family: var(--aviation-font-mono);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Chip Enhancements
   ============================================ */

.mud-theme-dark .mud-chip {
    border: 1px solid rgba(100, 181, 246, 0.2);
}

.mud-theme-dark .mud-chip.mud-chip-filled {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Divider Enhancements
   ============================================ */

.mud-theme-dark .mud-divider {
    border-color: rgba(100, 181, 246, 0.1);
}

/* ============================================
   Dialog Enhancements
   ============================================ */

.mud-theme-dark .mud-dialog {
    background: var(--aviation-surface);
    border: 1px solid rgba(100, 181, 246, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.mud-theme-dark .mud-dialog-title {
    background: linear-gradient(180deg, rgba(37, 37, 66, 1) 0%, rgba(26, 26, 46, 1) 100%);
    border-bottom: 1px solid rgba(100, 181, 246, 0.1);
}

/* ============================================
   Selection Styling
   ============================================ */

::selection {
    background-color: var(--aviation-primary);
    color: white;
}

.mud-theme-dark ::selection {
    background-color: var(--aviation-tertiary);
    color: white;
}
