/* ============================================
   Aircraft Lease Calculator - Professional Theme
   ============================================ */

:root {
    /* Color Palette */
    --primary: #1a3a52;
    --primary-light: #2d5a7b;
    --primary-dark: #0f2438;
    --accent: #00a8e8;
    --accent-light: #3bb8f0;
    --accent-dark: #0087b8;
    --success: #06a77d;
    --warning: #e8a500;
    --error: #d94545;

    /* Neutral Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e8ecf1;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-muted: #7a8494;
    --border: #d1d5db;
    --border-light: #e5e7eb;

    /* Typography */
    --font-display: 'Segoe UI', 'Trebuchet MS', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

/* ============================================
   Typography
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary);
}

h2 {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition-fast);
}

/* ============================================
   Form Controls
   ============================================ */

.form-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: var(--spacing-xl);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group:last-of-type {
    margin-bottom: var(--spacing-xl);
}

small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

input[type="number"] {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);


}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

input[type="number"]:hover:not(:focus) {
    border-color: var(--primary-light);
    background: var(--bg-primary);
}

/* ============================================
   Buttons
   ============================================ */

button {
    padding: 0.75rem var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

button:first-of-type {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    margin-right: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

button:first-of-type:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

button:first-of-type:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

button:last-of-type {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

button:last-of-type:hover {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

button:last-of-type:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Output Section
   ============================================ */

.error-message {
    background: rgba(217, 69, 69, 0.1);
    color: var(--error);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--error);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

.error-container {
    animation: slideUp 0.3s var(--transition-fast);
}

.output {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    min-height: 100px;
    animation: slideUp 0.4s var(--transition-base);
}

.output:empty {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container {
    animation: slideUp 0.4s var(--transition-base);
}

.results-header h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
}

.results-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.methodology-note {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(0, 168, 232, 0.05);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.result-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.15);
}

/* Result items styling */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    letter-spacing: -0.5px;
}

.result-value.highlight {
    color: var(--accent);
    font-size: 1.8rem;
}

.result-value.warning {
    color: var(--warning);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: var(--spacing-md);
    }

    h2 {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-md);
    }

    .form-container {
        padding: var(--spacing-lg);
    }

    button {
        padding: 0.65rem var(--spacing-md);
        font-size: 0.95rem;
    }

    button:first-of-type {
        margin-right: var(--spacing-sm);
    }

    .result-value {
        font-size: 1.25rem;
    }

    .result-value.highlight {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--spacing-md);
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }

    .form-container {
        padding: var(--spacing-md);
    }

    .form-group {
        margin-bottom: var(--spacing-md);
    }

    button {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-sm);
        margin-right: 0;
    }

    button:last-of-type {
        margin-bottom: 0;
    }

    .output {
        padding: var(--spacing-lg);
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .result-value {
        font-size: 1.1rem;
    }

    .result-value.highlight {
        font-size: 1.3rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    body {
        background: white;
        padding: 0;
    }

    button {
        display: none;
    }

    .output {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    h2 {
        page-break-after: avoid;
    }
}

/* ============================================
   Accessibility & Focus States
   ============================================ */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --bg-tertiary: #4a5568;
        --text-primary: #f7fafc;
        --text-secondary: #cbd5e0;
        --text-muted: #a0aec0;
        --border: #4a5568;
        --border-light: #2d3748;
    }

    body {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--primary-dark) 100%);
    }

    input[type="number"] {
        background: var(--bg-secondary);
    }

    input[type="number"]:focus {
        background: var(--bg-primary);
    }

    input[type="number"]:hover:not(:focus) {
        background: var(--bg-secondary);
    }
}