/* ============================================
   MOBILE HOME PARK OFFER CALCULATOR
   Professional Investment Tool Styling
   ============================================ */

/* ============================================
   CSS VARIABLES & THEME
   ============================================ */
:root {
    /* Color Palette - Financial/Data Aesthetic */
    --color-primary: #0f172a;          /* Deep slate */
    --color-secondary: #1e293b;        /* Slate 800 */
    --color-accent: #10b981;           /* Emerald - positive numbers */
    --color-accent-light: #34d399;     /* Lighter emerald */
    --color-warning: #f59e0b;          /* Amber */
    --color-surface: #f8fafc;          /* Light background */
    --color-surface-elevated: #ffffff; /* Card background */
    --color-border: #e2e8f0;           /* Soft borders */
    --color-border-strong: #cbd5e1;    /* Stronger borders */
    --color-text: #0f172a;             /* Primary text */
    --color-text-muted: #64748b;       /* Muted text */
    --color-text-light: #94a3b8;       /* Light text */
    --color-input-bg: #ffffff;         /* Editable inputs */
    --color-calculated-bg: #f1f5f9;    /* Read-only calculated */
    --color-calculated-border: #cbd5e1;
    
    /* Typography */
    --font-display: 'Manrope', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Sizing */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-display);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--space-xl) var(--space-md);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

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

/* ============================================
   HEADER
   ============================================ */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.title-accent {
    background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    background: var(--color-surface-elevated);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.section-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-border);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.01em;
}

.section-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ============================================
   INPUT GRIDS - PARK SECTION
   ============================================ */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-input-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-prefix,
.input-suffix {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0 var(--space-sm);
    background: var(--color-surface);
    user-select: none;
}

.input-field {
    flex: 1;
    border: none;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    outline: none;
    transition: background 0.2s ease;
}

.input-field.editable {
    background: var(--color-input-bg);
}

.input-field:focus {
    background: #fafafa;
}

/* Remove number input spinners for cleaner look */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================
   METRICS CARDS
   ============================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.metric-card {
    background: var(--color-calculated-bg);
    border: 2px solid var(--color-calculated-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card.highlight {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: var(--color-accent);
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.metric-card.highlight .metric-value {
    color: var(--color-accent);
}

/* Value update animation */
@keyframes valueUpdate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.value-updated {
    animation: valueUpdate 0.3s ease;
}

/* ============================================
   OFFERS GRID
   ============================================ */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

/* ============================================
   OFFER CARDS
   ============================================ */
.offer-card {
    background: var(--color-surface-elevated);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.offer-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.offer-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.offer-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.offer-number {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent-light);
    margin-bottom: var(--space-xs);
}

.offer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

/* ============================================
   COMPACT INPUTS (OFFER CARDS)
   ============================================ */
.offer-inputs {
    padding: var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: grid;
    gap: var(--space-md);
}

.input-group-compact {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-sm);
}

.input-label-compact {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.input-wrapper-compact {
    display: flex;
    align-items: center;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    min-width: 120px;
}

.input-wrapper-compact:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.input-field-compact {
    flex: 1;
    border: none;
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    outline: none;
    text-align: right;
}

.input-suffix-compact {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0 var(--space-sm);
    background: var(--color-surface);
    user-select: none;
}

/* ============================================
   OFFER RESULTS
   ============================================ */
.offer-results {
    padding: var(--space-lg);
    display: grid;
    gap: var(--space-sm);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--border-radius-sm);
    background: var(--color-calculated-bg);
    border-left: 3px solid var(--color-calculated-border);
    transition: all 0.2s ease;
}

.result-row.highlight {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left-color: var(--color-accent);
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.result-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.result-row.highlight .result-value {
    font-size: 1.25rem;
    color: var(--color-accent);
}

/* ============================================
   OFFER EXPLANATIONS
   ============================================ */
.offer-explanation {
    padding: var(--space-lg);
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid var(--color-border);
    flex-grow: 1;
}

.explanation-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.offer-explanation p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* ============================================
   BENEFIT SUMMARY
   ============================================ */
.benefit-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: var(--radius);
    border: 1px solid #fbbf24;
}

.benefit-column {
    min-width: 0;
}

.benefit-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: #b45309;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.benefit-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefit-list li {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}

.benefit-list li:before {
    content: "â†’";
    position: absolute;
    left: 0;
    color: #f59e0b;
    font-weight: 600;
}

.benefit-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .benefit-summary {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
}

/* ============================================
   DOWNLOAD BUTTONS
   ============================================ */
.download-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin: var(--space-xl) 0;
    flex-wrap: wrap;
}

.download-button {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-accent) 0%, #059669 100%);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    font-family: var(--font-display);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(16, 185, 129, 0.3);
}

.download-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.25rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .offers-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--space-md);
    }
    
    .title {
        font-size: 2rem;
    }
    
    .section {
        padding: var(--space-lg);
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .section {
        page-break-inside: avoid;
        box-shadow: none;
    }
    
    .offer-card:hover {
        transform: none;
        box-shadow: none;
    }
}
