:root {
    --brand:      #0e7490;
    --brand-dark: #0c5e75;
    --brand-light:#e0f7fa;
    --accent:     #10b981;
    --accent-dark:#059669;
    --text:       #1e293b;
    --text-muted: #64748b;
    --bg:         #ffffff;
    --bg-light:   #f8fafc;
    --bg-warm:    #f1f5f9;
    --border:     #e2e8f0;
    --radius:     0.75rem;
    --shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg:  0 10px 25px rgba(0,0,0,.08);
}

/* ── Base ── */
html { background: var(--bg); }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    overflow-y: scroll;
    overflow-x: hidden;
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.main-holder { margin-top: 60px; }

/* ── Hero Section ── */
.hero-section {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 50%, #06b6d4 100%);
    color: #fff;
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-subtitle strong { color: #fff; }

/* ── Upload Section ── */
.upload-section {
    padding: 2.5rem 0 3rem;
    background: var(--bg-light);
}

/* ── Dropzone ── */
.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all .25s ease;
    position: relative;
}

.dropzone:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.dropzone-active {
    border-color: var(--brand) !important;
    background: var(--brand-light) !important;
    box-shadow: 0 0 0 4px rgba(14,116,144,.15);
    transform: scale(1.01);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.dropzone-icon {
    color: var(--brand);
    margin-bottom: 1rem;
    opacity: .7;
}

.dropzone-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.dropzone-subtext {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.dropzone-subtext a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropzone-subtext a:hover { color: var(--brand-dark); }

.dropzone-formats {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ── Upload Progress ── */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: var(--text-muted);
}

.upload-progress .progress {
    border-radius: 3px;
    background: var(--bg-warm);
}

.upload-progress .progress-bar {
    background: var(--brand);
    transition: width .3s ease;
}

/* ── Result Card ── */
.result-card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp .4s ease;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    background: #ecfdf5;
    border-bottom: 1px solid #d1fae5;
}

.result-header-text {
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
}

.result-body { padding: 1.5rem; }

.result-filename {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    word-break: break-all;
}

.result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

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

.result-stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.result-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.result-stat-optimized { color: var(--brand); }

.result-stat-savings-box {
    background: #ecfdf5;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.result-stat-savings {
    color: var(--accent) !important;
    font-size: 1.5rem !important;
}

.result-stat-arrow { color: var(--text-muted); opacity: .4; }

/* ── Result Bar ── */
.result-bar-container { margin-bottom: 1.5rem; }

.result-bar {
    height: 10px;
    background: var(--bg-warm);
    border-radius: 5px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--brand));
    border-radius: 5px;
    transition: width .8s ease;
}

/* ── Result Actions ── */
.result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand);
    color: #fff;
    padding: 0.65rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background .2s;
}

.btn-download:hover { background: var(--brand-dark); color: #fff; }

.btn-new {
    border-radius: var(--radius);
    font-weight: 500;
}

.result-expiry {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* ── Features Section ── */
.features-section {
    padding: 4rem 0;
    background: var(--bg);
}

.features-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-light);
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

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

.feature-icon {
    color: var(--brand);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.65;
}

/* ── API CTA Section ── */
.api-cta-section {
    padding: 3.5rem 0;
    background: var(--bg-warm);
}

.api-cta-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.api-cta-section p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* ── Footer ── */
footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

footer a { color: var(--text-muted); transition: color .2s; }
footer a:hover { color: var(--brand); text-decoration: none; }

/* ── API Docs Page ── */
.api-docs-section {
    padding: 3rem 0;
}

.api-docs-section h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.api-docs-section .lead {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.endpoint-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.endpoint-method {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: .5px;
}

.endpoint-url {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--text);
    margin-left: 0.5rem;
}

.api-code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.83rem;
    line-height: 1.7;
    overflow-x: auto;
    margin: 1rem 0;
}

.api-code-block .comment { color: #64748b; }
.api-code-block .string  { color: #86efac; }
.api-code-block .keyword { color: #7dd3fc; }

.param-table {
    width: 100%;
    font-size: 0.9rem;
}

.param-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}

.param-table td, .param-table th {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.param-table code {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.badge-required {
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

.badge-optional {
    background: var(--bg-warm);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

/* ── Utilities ── */
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: .5rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-title { font-size: 1.75rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .dropzone { min-height: 200px; }
    .result-stats { gap: 0.75rem; }
    .result-stat-value { font-size: 1.1rem; }
    .result-stat-savings { font-size: 1.25rem !important; }
}
