/* Google Fonts are now loaded via <link> in HTML heads to avoid render-blocking @import */

:root {
    --primary-blue: #0a3d78;
    --primary-blue-dark: #082d5a;
    --accent-blue: #0f5ab9;
    --link-blue: #0c4ca3;
    --warning-yellow: #f2c94c;
    --body-bg: #f4f6fb;
    --surface: #ffffff;
    --card-border: #d9e2ef;
    --shadow-soft: 0 4px 20px rgba(10, 61, 120, 0.08);
    --text-color: #1f2a37;
    --muted-text: #4f5b6d;
}

*,
*::before,
*::after {
    border-radius: 0 !important;
}

html {
    min-height: 100%;
    background-color: var(--body-bg);
    background-image: url('images/forest_background.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: rgba(244, 246, 251, 0.92);
    background-image: url('images/forest_background.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
}

@media (max-width: 768px) {
    html,
    body {
        background-attachment: scroll;
    }
}

nav {
    background-color: var(--surface);
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 2px 20px rgba(10, 61, 120, 0.06);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

nav ul li {
    display: inline-block;
    margin: 0 1.25rem;
    vertical-align: top;
}

nav ul li a {
    color: var(--link-blue);
    text-decoration: none;
    padding: 0.65rem 1.35rem;
    display: block;
    border-radius: 999px;
    font-weight: 600;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

nav ul li a:hover {
    background-color: rgba(12, 76, 163, 0.08);
    box-shadow: 0 2px 6px rgba(10, 61, 120, 0.1);
}

nav ul li a.current {
    background-color: var(--link-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(10, 61, 120, 0.2);
}

main {
    flex: 1;
    padding: 2.5rem;
    max-width: 960px;
    margin: 2.5rem auto;
    background-color: var(--surface);
    box-shadow: var(--shadow-soft);
    border-radius: 14px;
    border: 1px solid var(--card-border);
}
footer {
    background-color: var(--surface);
    color: var(--muted-text);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--card-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.footer-text {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--text-color);
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logos a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-logos img {
    width: 280px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(9, 20, 58, 0.15));
    background: var(--surface);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
}

.footer-copy {
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted-text);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: center;
        gap: 3rem;
    }

    .footer-text {
        font-size: 1.05rem;
    }
}

/* Map specific styles */
#map {
    height: 400px;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    transform: translateZ(0); /* Enable hardware acceleration */
    will-change: transform; /* Optimize for transforms */
}

.point-coords-tooltip {
    background: rgba(79, 74, 69, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-size: 1.15rem;
    font-family: 'Source Sans 3', sans-serif;
    pointer-events: none;
}

.point-coords-tooltip::before,
.point-coords-tooltip::after {
    display: none;
}

/* Form styling */
form div {
    margin-bottom: 1rem;
}

.results-actions {
    margin: 1.5rem 0 0.5rem;
    display: flex;
    gap: 0.75rem;
}

.results-actions button {
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--primary-blue);
    background-color: var(--primary-blue);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.results-actions button:disabled {
    background-color: #c9d7eb;
    border-color: #b4c7e6;
    cursor: not-allowed;
    color: #ffffff;
}

.results-actions button:not(:disabled):hover {
    background-color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(12, 76, 163, 0.2);
    transform: translateY(-1px);
}

.form-field-header {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.form-field-header label {
    margin: 0;
    display: inline;
    flex: 0 1 auto;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: none;
    background: var(--primary-blue);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    flex: 0 0 auto;
}

.help-icon:hover,
.help-icon:focus-visible,
.help-icon.is-active {
    background: var(--accent-blue);
}

.help-icon:focus-visible {
    outline: 2px solid rgba(12, 76, 163, 0.4);
    outline-offset: 2px;
}

.help-content {
    margin-top: 0.5rem;
    padding: 0.75rem 0.9rem;
    background: #eef3fb;
    border-left: 3px solid var(--primary-blue);
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: none;
}

.help-content[hidden] {
    display: none;
}

.help-content.is-visible {
    display: block;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.results-summary {
    margin-top: 1rem;
    line-height: 1.5;
}

.results-summary .annual-output-highlight {
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: #edf2fb;
    border-left: 4px solid var(--primary-blue);
    border-radius: 4px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.results-summary .per-unit-highlight {
    margin-top: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: #e1ecfb;
    border-left: 4px solid var(--accent-blue);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.results-summary .per-unit-highlight strong {
    font-weight: 800;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
}

input[readonly] {
    background-color: #eee;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    color: var(--primary-blue);
}

button {
    padding: 0.8rem 1.8rem; /* Slightly larger padding */
    background-color: var(--primary-blue);
    color: #ffffff;
    border: none;
    border-radius: 999px; /* Slightly more rounded */
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600; /* Bolder text */
    font-family: 'Source Sans 3', sans-serif;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

button:disabled {
    background-color: #c9d7eb;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background-color: var(--accent-blue);
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 6px 18px rgba(12, 76, 163, 0.2); /* Add shadow on hover */
}

/* Results area */
#results {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #F5F5F5; /* Light Gray */
    border: 1px solid #DDDDDD; /* Gray border */
    border-radius: 4px;
}

#results h3 {
    margin-top: 0;
}

#results pre {
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto; /* Handle long lines */
}

/* Chart performance optimizations */
#results canvas {
    max-height: 400px;
    max-width: 100%;
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
    transform: translateZ(0); /* Enable hardware acceleration */
    will-change: transform;
}

.isochrone-control {
    margin: 1rem 0 2rem;
    padding: 0.75rem 1rem;
    background: #f0f5f1;
    border: 1px solid #d2ddd6;
    border-radius: 6px;
}

.point-intro {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #eef2fb;
    border-radius: 6px;
}

.point-intro p {
    margin: 0 0 0.75rem;
}

.point-intro p:last-child {
    margin-bottom: 0;
}

.isochrone-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.isochrone-control input[type="range"] {
    width: 100%;
}

/* Optimize form interactions */
select, input[type="text"], input[type="number"] {
    will-change: border-color, box-shadow;
}

/* Enhanced Error Handling Styles */
.error-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

.error-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid #e74c3c;
    overflow: hidden;
    position: relative;
}

.error-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.error-toast.removing {
    opacity: 0;
    transform: translateX(100%);
}

.error-network { border-left-color: #e74c3c; }
.error-validation { border-left-color: #f39c12; }
.error-server { border-left-color: #e67e22; }
.error-client { border-left-color: #9b59b6; }
.error-data { border-left-color: #3498db; }
.error-map { border-left-color: #27ae60; }

.error-content {
    padding: 16px 40px 16px 16px;
}

.error-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.error-icon {
    margin-right: 8px;
    font-size: 18px;
}

.error-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.error-message {
    color: #34495e;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.error-details {
    color: #7f8c8d;
    font-size: 11px;
    font-style: italic;
    margin-top: 4px;
}

.error-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    color: #bdc3c7;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.error-close:hover {
    color: #7f8c8d;
}

.error-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.error-action-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.error-action-btn:hover {
    background: #2980b9;
}

/* Loading Spinner Styles */
.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
}

.spinner-ring {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 32px;
    height: 32px;
    margin: 4px;
    border: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #3498db transparent transparent transparent;
}

.spinner-ring:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring:nth-child(2) { animation-delay: -0.3s; }
.spinner-ring:nth-child(3) { animation-delay: -0.15s; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

/* Enhanced Form Validation Styles */
.form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-field.error input,
.form-field.error select {
    border-color: var(--warning-yellow);
    box-shadow: 0 0 0 0.25rem rgba(242, 201, 76, 0.35);
}

.form-field.success input,
.form-field.success select {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(10, 61, 120, 0.25);
}

.field-error-message {
    color: var(--accent-blue);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.field-error-message::before {
    content: "";
    margin-right: 0;
}

.field-success-message {
    color: var(--primary-blue);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.field-success-message::before {
    content: "";
    margin-right: 0;
}

/* Enhanced Button Styles */
button {
    position: relative;
    overflow: hidden;
    padding: 0.8rem 1.8rem;
    background-color: var(--primary-blue);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Source Sans 3', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(10, 61, 120, 0.15);
}

button:disabled {
    background-color: #c9d7eb;
    cursor: not-allowed;
    color: #f9fbff;
    box-shadow: none;
    transform: none;
}

button:hover:not(:disabled) {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(10, 61, 120, 0.2);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ripple effect for buttons */
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Map Styles */
#map {
    height: 400px;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    will-change: transform;
    transition: box-shadow 0.3s ease;
}

#map:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Polygon Area Label Styling */
.polygon-area-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 6px !important;
    font-family: 'Source Sans 3', sans-serif !important;
    pointer-events: none !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.polygon-area-label::before {
    display: none !important;
}

/* Enhanced Results Area */
#results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

#results h3 {
    margin-top: 0;
    color: var(--primary-blue);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

#results h3::before {
    content: "";
    margin-right: 0;
}

/* Enhanced Action Link Blocks */
.action-link-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(10, 61, 120, 0.05);
}

.action-link-block:hover {
    box-shadow: 0 18px 40px rgba(10, 61, 120, 0.12);
    transform: translateY(-4px);
    background-color: rgba(255, 255, 255, 0.98);
}

.action-link-block:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 4px;
}

.action-link-block h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-blue);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
}

.action-link-block:nth-child(1) h3::before { content: ""; }
.action-link-block:nth-child(2) h3::before { content: ""; }
.action-link-block:nth-child(3) h3::before { content: ""; }
.action-link-block:nth-child(4) h3::before { content: ""; }

.action-link-block::after {
    content: '→';
    font-size: 1.5rem;
    color: var(--accent-blue);
    transition: transform 0.2s ease;
}

.action-link-block:hover::after {
    transform: translateX(4px);
}

/* Enhanced Info Area */
#info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f4fb 0%, #f8faff 100%);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

#info p {
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

#info p::before {
    margin-right: 0;
}

#info p:first-child::before { content: ""; }
#info p:last-child::before { content: ""; }

#info span {
    font-weight: bold;
    color: var(--primary-blue);
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
}

/* Error Fallback Styles */
.error-fallback {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: 1px solid #e17055;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-fallback h3 {
    color: #e17055;
    margin-bottom: 1rem;
}

.error-fallback p {
    color: #2d3436;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.error-fallback button {
    background: #e17055;
    color: white;
}

.error-fallback button:hover {
    background: #d63031;
}

.error-placeholder {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 1rem;
    background: #ecf0f1;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Enhanced Button States */
button.validation-error {
    background: linear-gradient(135deg, var(--warning-yellow) 0%, #e1b830 100%);
    color: white;
    animation: pulse-error 2s infinite;
}

button.validation-error:hover:not(:disabled) {
    background: linear-gradient(135deg, #e1b830 0%, #c99b1d 100%);
}

@keyframes pulse-error {
    0% { box-shadow: 0 2px 4px rgba(225, 184, 48, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(225, 184, 48, 0.5); }
    100% { box-shadow: 0 2px 4px rgba(225, 184, 48, 0.3); }
}

/* Enhanced Navigation */
nav ul li a {
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

nav ul li a:hover::before {
    opacity: 1;
}

nav ul li a:hover {
    transform: translateY(-1px);
}

nav ul li a.current {
    font-weight: 700;
}

/* Enhanced Header */
header {
    background-color: var(--surface);
    color: var(--primary-blue);
    padding: 1.75rem 0;
    box-shadow: 0 2px 20px rgba(10, 61, 120, 0.08);
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    gap: 1.75rem;
}

.logo-link {
    flex-shrink: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.logo-link img {
    display: block;
    width: 160px;
    max-width: 35vw;
}

.header-text {
    flex-grow: 1;
}

.site-title {
    margin: 0;
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.2rem);
    line-height: 1.3;
    color: var(--primary-blue);
}

/* Enhanced Footer */
/* Chart Container Enhancements */
#results canvas {
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Form Section Headers */
form h3 {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

form h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

form h3:hover::after {
    width: 100%;
}

/* Layer Info Enhancement */
.layer-info {
    background: linear-gradient(135deg, #f5f7fc 0%, #eef2fb 100%);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.layer-info::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.layer-info h3 {
    color: var(--primary-blue);
    margin-top: 0;
    display: flex;
    align-items: center;
}

.layer-info h3::before {
    content: '';
    margin-right: 0;
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .error-toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
        top: 10px;
    }
    
    .error-toast {
        transform: translateY(-100%);
    }
    
    .error-toast.show {
        transform: translateY(0);
    }
    
    .error-toast.removing {
        transform: translateY(-100%);
    }
    
    main {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .action-link-block {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .logo-link img {
        width: 100px;
    }
    
    nav ul li {
        display: block;
        margin: 0.5rem 0;
    }
    
    form h3 {
        font-size: 1.1rem;
    }
}

/* --- Styling for Dynamically Generated Results --- */
.results-content {
    padding-left: 10px; /* Base padding for the results container */
}

.result-item {
    margin-bottom: 8px; /* Space between items */
    padding-left: 15px; /* Indentation for each item */
    border-left: 2px solid #eee; /* Visual indicator for items */
}

.result-item strong {
    color: #333; /* Darker color for keys */
}

.result-array {
    list-style: none; /* Remove default bullets */
    padding-left: 20px; /* Indentation for array items */
    margin-top: 5px;
    margin-bottom: 5px;
}

.result-array li {
    margin-bottom: 5px; /* Space between array items */
    padding-left: 10px;
    border-left: 1px dashed #ccc; /* Visual indicator for array items */
}

.result-nested-object {
    margin-top: 5px;
    padding-left: 20px; /* Indentation for nested objects */
    border-left: 2px solid #ddd; /* Visual indicator for nested objects */
}
/* --- End Results Styling --- */

/* Download Page Specific Styles */
.data-info-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f5f7fc 0%, #eef2fb 100%);
    border-radius: 12px;
    border-left: 5px solid var(--primary-blue);
}

.dataset-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dataset-item {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    box-shadow: 0 6px 16px rgba(10, 61, 120, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dataset-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(10, 61, 120, 0.12);
}

.dataset-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-blue);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataset-item p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.email-form-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
}

.download-form {
    max-width: 500px;
}

.download-form h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-form h3::before {
    content: '';
    display: none;
}

.download-form .form-field {
    margin-bottom: 1.5rem;
}

.download-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.download-form input[type="email"],
.download-form input[type="text"],
.download-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.download-form input[type="email"]:focus,
.download-form input[type="text"]:focus,
.download-form select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(12, 76, 163, 0.15);
}

.download-form button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.download-form button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 61, 120, 0.2);
}

.download-form button:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-status {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1.5rem;
    border-radius: 8px;
}

.success-message h4 {
    margin: 0 0 0.75rem 0;
    color: #155724;
    font-size: 1.1rem;
}

.success-message p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 8px;
}

.error-message h4 {
    margin: 0 0 0.75rem 0;
    color: #721c24;
    font-size: 1.1rem;
}

.error-message p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

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

/* Responsive adjustments for download page */
@media (max-width: 768px) {
    .dataset-list {
        grid-template-columns: 1fr;
    }
    
    .email-form-section {
        padding: 1.5rem;
    }
    
    .download-form button {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* EmailJS Setup Instructions */
.setup-instructions {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.setup-instructions h4 {
    margin: 0 0 1rem 0;
    color: #856404;
    font-size: 1.1rem;
}

.setup-instructions ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.setup-instructions li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.setup-instructions ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.setup-instructions ul li {
    margin-bottom: 0.25rem;
}

.setup-instructions code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.setup-instructions a {
    color: #856404;
    font-weight: 600;
    text-decoration: underline;
}

.setup-instructions a:hover {
    color: #533f03;
}

.setup-help-btn,
.close-setup-btn {
    background: #856404;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.2s ease;
}

.setup-help-btn:hover,
.close-setup-btn:hover {
    background: #533f03;
}

.close-setup-btn {
    float: right;
    margin-top: -0.5rem;
}


/* Index page specific styles */
.intro-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
    color: var(--muted-text);
}
