/* ============================================
   LoanCalc Pro - Modern Financial Calculator
   Design System: Warm Coral & Deep Navy
   Typography: DM Sans + Fraunces
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors - Warm Coral Theme */
    --coral-50: #fff5f2;
    --coral-100: #ffe8e1;
    --coral-200: #ffd5c8;
    --coral-300: #ffb8a3;
    --coral-400: #ff8f6d;
    --coral-500: #f97342;
    --coral-600: #e65a28;
    --coral-700: #c0461e;
    --coral-800: #9d3b1d;
    --coral-900: #82351d;
    
    /* Navy Accents */
    --navy-50: #f0f4f8;
    --navy-100: #d9e2ec;
    --navy-200: #bcccdc;
    --navy-300: #9fb3c8;
    --navy-400: #829ab1;
    --navy-500: #627d98;
    --navy-600: #486581;
    --navy-700: #334e68;
    --navy-800: #243b53;
    --navy-900: #102a43;
    
    /* Semantic Colors */
    --bg-primary: #fefdfb;
    --bg-secondary: #faf8f5;
    --bg-card: #ffffff;
    --text-primary: #102a43;
    --text-secondary: #486581;
    --text-muted: #829ab1;
    --border-color: #d9e2ec;
    --border-light: #e8eef3;
    
    /* Accent Colors */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.04);
    --shadow-md: 0 4px 8px rgba(16, 42, 67, 0.06), 0 2px 4px rgba(16, 42, 67, 0.04);
    --shadow-lg: 0 10px 20px rgba(16, 42, 67, 0.08), 0 4px 8px rgba(16, 42, 67, 0.04);
    --shadow-xl: 0 20px 40px rgba(16, 42, 67, 0.1), 0 8px 16px rgba(16, 42, 67, 0.06);
    
    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
.bg-pattern {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--coral-100), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, var(--coral-50), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, var(--navy-50), transparent),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    opacity: 1;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ============================================
   Header
   ============================================ */
.header {
    text-align: center;
    padding: var(--space-2xl) 0;
    animation: fadeInDown 0.6s ease-out;
    position: relative;
}

.header-actions {
    position: absolute;
    top: var(--space-lg);
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-share:hover {
    color: var(--coral-600);
    border-color: var(--coral-300);
    background: var(--coral-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.language-selector {
    position: relative;
}

.language-select {
    padding: var(--space-sm) var(--space-md);
    padding-right: var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23486581' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
    background-size: 12px;
}

.language-select:hover {
    color: var(--text-primary);
    border-color: var(--navy-300);
}

.language-select:focus {
    outline: none;
    border-color: var(--coral-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 66, 0.1);
}

@media (max-width: 768px) {
    .header-actions {
        position: static;
        justify-content: center;
        margin-top: var(--space-md);
    }
    
    .btn-share span {
        display: none;
    }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--navy-900);
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--coral-500);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================
   Main Calculator Tabs
   ============================================ */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.main-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
}

.main-tab:hover {
    color: var(--text-primary);
    border-color: var(--navy-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.main-tab.active {
    color: var(--coral-600);
    background: var(--coral-50);
    border-color: var(--coral-300);
    box-shadow: var(--shadow-md);
}

.main-tab svg {
    opacity: 0.7;
}

.main-tab.active svg {
    opacity: 1;
    color: var(--coral-500);
}

/* ============================================
   Calculator Container & Grid
   ============================================ */
.calculator-container {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.calculator-panel {
    display: none;
}

.calculator-panel.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* ============================================
   Input Section
   ============================================ */
.input-section {
    position: sticky;
    top: var(--space-lg);
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

.input-card {
    border-top: 4px solid var(--coral-400);
}

.card-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy-900);
    margin-bottom: var(--space-xl);
}

.title-icon {
    font-size: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.label-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    pointer-events: none;
}

.input-prefix {
    left: var(--space-md);
}

.input-suffix {
    right: var(--space-md);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--coral-400);
    box-shadow: 0 0 0 4px var(--coral-100);
}

.input-wrapper input {
    padding-left: 2.5rem;
}

.input-wrapper input:has(+ .input-suffix) {
    padding-right: 2.5rem;
    padding-left: var(--space-md);
}

/* Input with prefix */
.input-wrapper:has(.input-prefix) input {
    padding-left: 2.5rem;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23486581' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: 2.5rem !important;
}

/* Payment Type Options */
.payment-types {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.payment-type-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.payment-type-option:hover {
    background: var(--coral-50);
    border-color: var(--coral-200);
}

.payment-type-option.selected,
.payment-type-option:has(input:checked) {
    background: var(--coral-50);
    border-color: var(--coral-400);
}

.payment-type-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--coral-500);
    cursor: pointer;
}

.option-content {
    flex: 1;
}

.option-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.option-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Calculate Button */
.btn-calculate {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--coral-500) 0%, var(--coral-600) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(249, 115, 66, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 66, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate svg {
    transition: transform var(--transition-base);
}

.btn-calculate:hover svg {
    transform: translateX(4px);
}

/* Secondary Button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: var(--navy-100);
    border-color: var(--navy-300);
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    min-height: 600px;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.summary-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

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

.summary-card.primary {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-900) 100%);
    border: none;
}

.summary-card.primary.savings {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
}

.summary-card.primary .summary-label,
.summary-card.primary .summary-value {
    color: white;
}

.summary-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.summary-content {
    flex: 1;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.summary-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Result Tabs */
.result-tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.result-tab {
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.result-tab:hover {
    color: var(--text-primary);
}

.result-tab.active {
    color: var(--coral-600);
    border-bottom-color: var(--coral-500);
}

/* Tab Content */
.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Section Title */
.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: var(--space-lg);
}

/* Detail List */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.detail-row:hover {
    background: var(--navy-50);
}

.detail-row.highlight {
    background: linear-gradient(135deg, var(--coral-50) 0%, var(--coral-100) 100%);
    border: 1px solid var(--coral-200);
}

.detail-row.highlight:hover {
    background: linear-gradient(135deg, var(--coral-100) 0%, var(--coral-200) 100%);
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.detail-row.highlight .detail-value {
    color: var(--coral-700);
}

/* ============================================
   Amortization Schedule Table
   ============================================ */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.table-container {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--space-xl));
    padding: 0 var(--space-xl);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table thead {
    position: sticky;
    top: 0;
    background: var(--navy-50);
}

.schedule-table th {
    padding: var(--space-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
    border-bottom: 2px solid var(--border-color);
}

.schedule-table th:first-child {
    text-align: center;
    border-radius: var(--radius-sm) 0 0 0;
}

.schedule-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.schedule-table tbody tr {
    transition: background var(--transition-fast);
}

.schedule-table tbody tr:hover {
    background: var(--navy-50);
}

.schedule-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.schedule-table tbody tr:nth-child(even):hover {
    background: var(--navy-50);
}

.schedule-table td {
    padding: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    border-bottom: 1px solid var(--border-light);
}

.schedule-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.pagination button {
    min-width: 40px;
    height: 40px;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--navy-100);
    border-color: var(--navy-300);
}

.pagination button.active {
    color: white;
    background: var(--coral-500);
    border-color: var(--coral-500);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   Charts
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.chart-card {
    padding: var(--space-xl);
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   Ad Containers
   ============================================ */
.ad-container {
    margin: var(--space-xl) 0;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--navy-50) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-horizontal .ad-placeholder {
    height: 90px;
}

.ad-vertical {
    margin-top: var(--space-lg);
}

.ad-vertical .ad-placeholder {
    height: 300px;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
    margin: var(--space-2xl) 0;
    padding: var(--space-2xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.faq-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy-900);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.faq-item {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--coral-400);
}

.faq-item h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    margin-top: var(--space-xl);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-brand .logo-icon {
    font-size: 1.5rem;
}

.footer-brand .logo-text {
    font-size: 1.25rem;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Animation classes */
.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .calculator-grid {
        grid-template-columns: 350px 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        position: static;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-vertical {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }
    
    .header {
        padding: var(--space-xl) 0;
    }
    
    .logo-text {
        font-size: 1.75rem;
    }
    
    .main-tabs {
        flex-direction: column;
    }
    
    .main-tab {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        padding: var(--space-lg);
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary-value {
        font-size: 1.25rem;
    }
    
    .result-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .result-tab {
        padding: var(--space-sm) var(--space-md);
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
    
    .faq-section {
        padding: var(--space-lg);
    }
    
    .faq-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .pagination button {
        min-width: 36px;
        height: 36px;
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .bg-pattern,
    .ad-container,
    .main-tabs,
    .result-tabs,
    .btn-calculate,
    .btn-secondary,
    .pagination,
    .faq-section,
    .footer {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        max-width: 100%;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .summary-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   Dark Mode (optional, auto-detect)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-card: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border-color: #334155;
        --border-light: #475569;
    }
    
    .bg-pattern {
        background: 
            radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249, 115, 66, 0.1), transparent),
            radial-gradient(ellipse 60% 40% at 100% 50%, rgba(249, 115, 66, 0.05), transparent),
            linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    }
    */
}
