/* Apple-inspired Minimalist Design System with Orange Accents */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Primary White-Orange Color Palette */
  --primary-white: #FFFFFF;
  --primary-orange: #FF6B35;
  --primary-orange-light: #FF8C5A;
  --primary-orange-lighter: #FFB085;
  --primary-orange-dark: #E55A2B;
  --primary-orange-darker: #CC4A1F;
  
  /* Orange Gradient Colors */
  --orange-gradient-start: #FF6B35;
  --orange-gradient-mid: #FF8C5A;
  --orange-gradient-end: #FFB085;
  
  /* White Variations */
  --white-pure: #FFFFFF;
  --white-warm: #FFFBF8;
  --white-soft: #FFF8F5;
  --white-cream: #FFF5F0;
  
  /* Neutral Colors - White-Orange Theme */
  --gray-50: #FFFBF8;
  --gray-100: #FFF5F0;
  --gray-200: #FFE8DC;
  --gray-300: #FFD4C4;
  --gray-400: #FFBFA8;
  --gray-500: #CC9580;
  --gray-600: #996B5C;
  --gray-700: #664238;
  --gray-800: #4D2E26;
  --gray-900: #331A14;
  --black: #1A0A08;
  
  /* System Colors with White-Orange Integration */
  --system-red: #FF4444;
  --system-orange: var(--primary-orange);
  --system-yellow: #FFB800;
  --system-green: #4CAF50;
  --system-blue: #2196F3;
  --system-purple: #9C27B0;
  --system-pink: #E91E63;
  
  /* Apple Colors */
  --apple-blue: var(--system-blue);
  --apple-blue-dark: #1976D2;
  
  /* Background Colors */
  --background-primary: var(--white-pure);
  --background-secondary: var(--white-warm);
  --background-tertiary: var(--white-soft);
  --background-orange-light: rgba(255, 107, 53, 0.05);
  --background-orange-medium: rgba(255, 107, 53, 0.1);
  --background-orange-strong: rgba(255, 107, 53, 0.15);
  
  /* Gradient Backgrounds */
  --gradient-orange-light: linear-gradient(135deg, var(--white-pure) 0%, var(--white-soft) 100%);
  --gradient-orange-medium: linear-gradient(135deg, var(--orange-gradient-end) 0%, var(--orange-gradient-start) 100%);
  --gradient-orange-strong: linear-gradient(135deg, var(--orange-gradient-start) 0%, var(--orange-gradient-darker) 100%);
  --gradient-white-orange: linear-gradient(135deg, var(--white-pure) 0%, var(--background-orange-light) 100%);
  
  /* Text Colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-700);
  --text-tertiary: var(--gray-600);
  --text-quaternary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-orange: var(--primary-orange);
  --text-orange-dark: var(--primary-orange-dark);
  --text-white: var(--white-pure);
  
  /* Border Colors */
  --separator: var(--gray-200);
  --separator-opaque: var(--gray-300);
  --border-orange: var(--primary-orange);
  --border-orange-light: var(--primary-orange-light);
  --border-white: var(--white-pure);
  
  /* Interactive States */
  --hover-orange: rgba(255, 107, 53, 0.1);
  --active-orange: rgba(255, 107, 53, 0.2);
  --focus-orange: rgba(255, 107, 53, 0.3);
  --hover-white: rgba(255, 255, 255, 0.1);
  --active-white: rgba(255, 255, 255, 0.2);
  
  /* Semi-transparent overlays */
  --overlay-light: rgba(255, 255, 255, 0.1);
  --overlay-medium: rgba(255, 255, 255, 0.2);
  --overlay-heavy: rgba(255, 255, 255, 0.3);
  --overlay-modal: rgba(255, 255, 255, 0.85);
  --overlay-backdrop: rgba(255, 255, 255, 0.9);
  --overlay-strong: rgba(255, 255, 255, 0.95);
  
  /* Shadows - White-Orange Theme */
  --shadow-light: 0 2px 8px rgba(255, 107, 53, 0.08);
  --shadow-medium: 0 4px 16px rgba(255, 107, 53, 0.12);
  --shadow-heavy: 0 8px 32px rgba(255, 107, 53, 0.16);
  --shadow-orange: 0 4px 16px rgba(255, 107, 53, 0.2);
  --shadow-orange-heavy: 0 8px 32px rgba(255, 107, 53, 0.25);
  --shadow-white: 0 2px 8px rgba(255, 255, 255, 0.5);
  
  /* Typography */
  --font-family-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-text: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing - Apple's 8pt Grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  
  /* Border Radius */
  --radius-small: 6px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-xlarge: 16px;
  
  /* Transitions */
  --transition-quick: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-smooth: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Apple-style Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-text);
    line-height: 1.47;
    color: var(--text-primary);
    background: var(--background-primary);
    letter-spacing: -0.003em;
}

/* Apple Typography Enhanced */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.083;
}

h2 {
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
}

h3 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.125;
}

h4 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.167;
}

/* Enhanced Paragraph Styles */
p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.47;
}

/* Enhanced Link Styles with Orange Accents */
a {
    color: var(--apple-blue);
    text-decoration: none;
    transition: all var(--transition-quick);
    position: relative;
}

a:hover {
    color: var(--primary-orange);
    transform: translateY(-1px);
}

a:active {
    transform: translateY(0);
}

/* Apple Button Styles Enhanced with Orange Variants */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-large);
    font-family: var(--font-family-text);
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-quick);
    min-height: 44px;
    letter-spacing: -0.022em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--overlay-medium), transparent);
    transition: left var(--transition-smooth);
}

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

.btn-primary {
    background: var(--apple-blue);
    color: var(--white);
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    background: var(--apple-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

/* New Orange Button Variants */
.btn-orange {
    background: var(--primary-orange);
    color: var(--white);
    box-shadow: var(--shadow-orange);
}

.btn-orange:hover {
    background: var(--primary-orange-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange-heavy);
}

.btn-orange:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.btn-orange-outline {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-orange-outline:hover {
    background: var(--primary-orange);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange);
}

.btn-orange-ghost {
    background: var(--background-orange-light);
    color: var(--primary-orange-dark);
    border: 1px solid var(--border-orange-light);
}

.btn-orange-ghost:hover {
    background: var(--background-orange-medium);
    border-color: var(--border-orange);
    transform: translateY(-1px);
}

/* Apple Button Styles - Secondary and Form Elements */
.btn-secondary {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}

.btn-secondary:hover {
    background: var(--background-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* Apple Form Elements Enhanced */
.form-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 400;
    color: var(--text-primary);
    font-size: 17px;
    transition: color var(--transition-quick);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--separator);
    border-radius: var(--radius-medium);
    font-size: 17px;
    font-family: var(--font-family-text);
    background: var(--background-primary);
    color: var(--text-primary);
    transition: all var(--transition-quick);
    min-height: 44px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px var(--focus-orange);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* Enhanced Form States */
.form-group.focused .form-label {
    color: var(--primary-orange);
}

.form-group.error .form-input {
    border-color: var(--system-red);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.form-group.success .form-input {
    border-color: var(--system-green);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

/* Apple Card Component Enhanced */
.card {
    background: var(--background-primary);
    border-radius: var(--radius-large);
    padding: var(--space-6);
    border: 1px solid var(--separator-opaque);
    transition: all var(--transition-quick);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-orange), var(--primary-orange-light));
    transform: scaleX(0);
    transition: transform var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Apple Modal Styles Enhanced */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-modal);
    backdrop-filter: saturate(180%) blur(20px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--background-primary);
    border-radius: var(--radius-large);
    border: 1px solid var(--separator);
    box-shadow: var(--shadow-heavy);
    max-width: 1600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform var(--transition-smooth);
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Apple Loading States Enhanced */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--separator);
    border-radius: 50%;
    border-top-color: var(--primary-orange);
    animation: spin 1s linear infinite;
}

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

/* Message Types Enhanced with Orange */
.message {
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid;
    margin-bottom: var(--space-4);
    font-weight: 500;
}

.message.success {
    background: var(--overlay-strong);
    color: var(--system-green);
    border-color: var(--system-green);
}

.message.error {
    background: var(--overlay-strong);
    color: var(--system-red);
    border-color: var(--system-red);
}

.message.warning {
    background: var(--overlay-strong);
    color: var(--primary-orange-dark);
    border-color: var(--primary-orange);
}

.message.info {
    background: var(--overlay-strong);
    color: var(--apple-blue);
    border-color: var(--apple-blue);
}

/* Apple Utility Classes Enhanced */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.hidden { display: none; }
.show { display: block !important; }
.hide { display: none !important; }

.rounded { border-radius: var(--radius-medium); }
.rounded-lg { border-radius: var(--radius-large); }

.transition { transition: all var(--transition-quick); }

/* Enhanced Focus States */
*:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Enhanced Scrollbar with Orange Accents */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-orange), var(--primary-orange-light));
    border-radius: 10px;
    transition: background var(--transition-quick);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--primary-orange-dark), var(--primary-orange));
}

/* Apple Responsive Design Enhanced */
@media (max-width: 768px) {
    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
    
    .card {
        padding: var(--space-4);
    }
    
    .modal-content {
        margin: var(--space-4);
        width: calc(100% - 32px);
        max-width: 1600px;
    }
    
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    
    .card {
        padding: var(--space-3);
    }
    
    .modal-content {
        margin: var(--space-2);
        width: calc(100% - 16px);
        max-width: 1600px;
    }
}

/* Apple Accessibility Enhanced */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Forced Light Theme - Always White Background */
:root {
    --background-primary: var(--white-pure) !important;
    --background-secondary: var(--white-warm) !important;
    --background-tertiary: var(--white-soft) !important;
    --text-primary: var(--gray-900) !important;
    --text-secondary: var(--gray-700) !important;
    --text-tertiary: var(--gray-600) !important;
    --separator: rgba(255, 107, 53, 0.1) !important;
    --separator-opaque: rgba(255, 107, 53, 0.2) !important;
}

/* Print Styles */
@media print {
    .fab,
    .tooltip,
    .btn-modern {
        display: none !important;
    }
    
    .card-modern {
        box-shadow: none;
        border: 1px solid var(--separator);
    }
    
    body {
        background: var(--background-primary);
        color: var(--primary-orange);
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
.btn-modern:focus,
.form-input-modern:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-modern {
        border: 2px solid currentColor;
    }
    
    .card-modern {
        border: 2px solid currentColor;
    }
}