/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: #1a202c;
    background-color: #eaf1f7;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0) 42%),
        radial-gradient(circle at 86% 12%, rgba(30, 64, 175, 0.12) 0%, rgba(30, 64, 175, 0) 36%),
        linear-gradient(180deg, #f7fbff 0%, #edf3f9 58%, #e6eef6 100%);
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    position: relative; 
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(30, 64, 175, 0.03) 0,
            rgba(30, 64, 175, 0.03) 1px,
            transparent 1px,
            transparent 24px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(59, 130, 246, 0.02) 0,
            rgba(59, 130, 246, 0.02) 1px,
            transparent 1px,
            transparent 28px
        );
    opacity: 0.65;
    pointer-events: none;
    z-index: 0;
}

header, .container, footer {
    position: relative;
    z-index: 1; 
}

.container {
    max-width: 1280px;
    margin: 0px auto;
    margin-bottom: 20px;
        margin-top: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
    flex: 1 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 10px;
    padding: 48px 32px;
    box-shadow: 
        0 20px 25px -5px rgba(30, 64, 175, 0.15),
        0 10px 10px -5px rgba(30, 64, 175, 0.04);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
}

header h1 {
    color: rgb(22, 22, 22);
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

header h2, header p {
    color: rgba(22, 22, 22);
    font-size: 1.375rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

/* Navigation */
nav {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    display: inline-block;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Info Box */
.info-box {
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.04),
        0 4px 6px -2px rgba(0, 0, 0, 0.02);
    position: relative;
}

.info-box ul {
    margin: 16px 0;
    padding-left: 20px;
}

.info-box li {
    margin: 8px 0;
    line-height: 1.6;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    border-radius: 16px 16px 0 0;
}

.info-box h3 {
    color: #0f172a;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.info-box p {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 16px;
    font-weight: 400;
}

.info-box p:last-of-type {
    margin-bottom: 0;
}

.info-header h3 {
    color: #0f172a;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
    letter-spacing: -0.02em;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.info-item:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.08),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    border-color: rgba(30, 64, 175, 0.2);
}

.info-item:hover::before {
    opacity: 1;
}

.info-icon {
    font-size: 2.25rem;
    line-height: 1;
    flex-shrink: 0;
    color: #1e40af;
}

.info-text strong {
    display: block;
    color: #0f172a;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.info-text p {
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .info-content {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .info-icon {
        font-size: 2.5rem;
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 32px;
    align-items: flex-end;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.commune-selector {
    flex: 1;
    min-width: 320px;
}

.commune-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #0f172a;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

/* Dropdown */
.dropdown-container {
    position: relative;
}

#commune-search {
    width: 100%;
    padding: 16px 48px 16px 20px;
    font-size: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #0f172a;
    font-weight: 500;
    letter-spacing: -0.01em;
}

#commune-search:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 
        0 0 0 3px rgba(30, 64, 175, 0.12),
        0 1px 3px 0 rgba(0, 0, 0, 0.08);
    background: #fefefe;
}

#commune-search::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    z-index: 2;
    font-size: 0.875rem;
}

.dropdown-arrow:hover {
    color: #1e40af;
}

.dropdown-arrow.open {
    color: #1e40af;
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #4299e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f7fafc;
    color: #2d3748;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #ebf8ff;
}

.dropdown-item.selected {
    background: #4299e1;
    color: white;
}

.dropdown-item.no-results {
    color: #a0aec0;
    font-style: italic;
    cursor: default;
}

.dropdown-item.no-results:hover {
    background: transparent;
}

.dropdown-item mark {
    background-color: #fed7d7;
    color: #c53030;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.dropdown-item.selected mark {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 2px 4px -1px rgba(0, 0, 0, 0.04);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transition: left 0.5s ease;
    pointer-events: none;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px -5px rgba(30, 64, 175, 0.25),
        0 4px 6px -2px rgba(30, 64, 175, 0.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    transition-duration: 0.1s;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px 0 rgba(0, 0, 0, 0.06);
    color: #ffffff;
    opacity: 0.7;
}

.btn-secondary {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px -5px rgba(5, 150, 105, 0.25),
        0 4px 6px -2px rgba(5, 150, 105, 0.1);
}

/* Loading */
.loading {
    text-align: center;
    padding: 64px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    margin: 32px 0;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1e40af;
    border-right: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 32px;
}

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

.loading p {
    font-size: 1.125rem;
    color: #374151;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Results */
.results {
    margin-top: 40px;
}

.results-header h3 {
    color: white;
    font-size: 1.625rem;
    margin-bottom: 32px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: 
        0 10px 15px -3px rgba(30, 64, 175, 0.15),
        0 4px 6px -2px rgba(30, 64, 175, 0.05);
}

/* Total count styling */
#kommune-total {
    margin: -12px 0 32px 0;
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    padding: 20px 30px;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 22px -6px rgba(30,64,175,0.45), 0 4px 10px -2px rgba(30,64,175,0.25);
    position: relative;
    overflow: hidden;
}

#kommune-total::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 25%, rgba(255,255,255,0.25), transparent 70%),
                radial-gradient(circle at 85% 70%, rgba(255,255,255,0.18), transparent 65%);
    pointer-events: none;
}

#kommune-total .label {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    padding: 6px 11px 5px 11px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(2px);
}

#kommune-total .value {
    font-size: 2.1rem;
    font-weight: 800;
    background: linear-gradient(90deg,#ffffff,#e0f2fe,#bfdbfe);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 3px 10px rgba(15,23,42,0.35), 0 0 0 rgba(0,0,0,0.2);
}

@media (max-width: 640px) {
    #kommune-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        width: 100%;
    }
    #kommune-total .value { font-size: 1.75rem; }
}

    /* --- Rankings & DataTables overrides (moved to global scope) --- */
    table.dataTable thead th {
        background: #1e40af;
        color: #fff;
        font-weight: 600;
    }
    table.dataTable tbody tr:nth-child(even) { background: #f1f5f9; }
    table.dataTable tbody tr:hover { background: #e2e8f0; }
    .ranking-section h3 { margin-bottom: 12px; }
    #thema-select { padding:6px 10px; border-radius:6px; border:1px solid #cbd5e1; }
    table.dataTable { width: 100% !important; border-collapse: collapse; }
    table.dataTable td, table.dataTable th { padding: 8px 12px; }

/* Chart */
.chart-container {
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
    /* max-height entfernt, damit die dynamische Canvas-Höhe greifen kann */
    border: 1px solid #e2e8f0;
}

/* Data Tables */
.table-section h4 {
    color: #0f172a;
    margin-bottom: 32px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 28px;
}

.thema-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.04),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.thema-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.08),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(30, 64, 175, 0.2);
}

.thema-card h5 {
    color: #0f172a;
    margin-bottom: 24px;
    font-size: 1.25rem;
    border-bottom: 3px solid #1e40af;
    padding-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    font-weight: 600;
    gap: 16px;
}

.stats .vorhanden {
    color: #0f5132;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #10b981;
    flex: 1;
    text-align: center;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.stats .potenzial {
    color: #9a3412;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
    flex: 1;
    text-align: center;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.bezeichnungen h6 {
    color: #2d3748;
    margin-bottom: 12px;
    font-weight: 600;
}

.bezeichnung-list {
    list-style: none;
    padding: 0;
}

.bezeichnung-list li {
    padding: 12px;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    border-radius: 4px;
    margin-bottom: 4px;
}

.bezeichnung-list li:hover {
    background: #f7fafc;
}

.badge {
    background: linear-gradient(135deg, #4299e1, #2b6cb0);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* CSV Upload Link Section for main page */
.csv-upload-link {
    margin-top: 32px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.04),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
    text-align: center;
}

.csv-upload-link h3 {
    color: #0f172a;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.csv-upload-link p {
    color: #4a5568;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-top: 64px;
    padding: 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: #1e40af;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.upload-section h3 {
    color: #0f172a;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.upload-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#csv-upload {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
}

.upload-status {
    margin-top: 16px;
    padding: 16px;
    border-radius: 6px;
    font-weight: 500;
}

.upload-status.success {
    background: rgba(72, 187, 120, 0.1);
    color: #22543d;
    border: 1px solid #68d391;
}

.upload-status.error {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
    border: 1px solid #fc8181;
}

.upload-status.info {
    background: rgba(66, 153, 225, 0.1);
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

.upload-status.loading {
    background: rgba(255, 193, 7, 0.1);
    color: #d69e2e;
    border: 1px solid #fbd38d;
}

/* Drag and Drop Styles */
.upload-section.drag-over {
    border-color: #3182ce;
    background: rgba(66, 153, 225, 0.05);
}

/* Upload Success Details */
.upload-success-details {
    margin-top: 16px;
    padding: 16px;
    background: rgba(72, 187, 120, 0.05);
    border: 1px solid rgba(72, 187, 120, 0.2);
    border-radius: 6px;
    font-size: 14px;
}

.upload-success-details ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.upload-success-details li {
    margin: 4px 0;
}

/* Upload History */
.upload-history {
    margin-top: 64px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.04),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.upload-history h3 {
    color: #0f172a;
    margin-bottom: 24px;
    border-bottom: 3px solid #1e40af;
    padding-bottom: 16px;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.upload-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-history-item {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.upload-history-item.success {
    border-left: 4px solid #48bb78;
}

.upload-history-item.error {
    border-left: 4px solid #f56565;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-header .filename {
    font-weight: 600;
    color: #2d3748;
}

.history-item-header .timestamp {
    font-size: 12px;
    color: #718096;
}

.history-item-details {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    color: #4a5568;
}

.history-item-details .status.success {
    color: #38a169;
}

.history-item-details .status.error {
    color: #e53e3e;
}

/* API Testing Section */
.api-testing-section {
    margin-top: 64px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.04),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

/* API Testing Link Section for main page */
.api-testing-link {
    margin-top: 64px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.04),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
    text-align: center;
}

.api-testing-link h3 {
    color: #0f172a;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.api-testing-link p {
    color: #4a5568;
    margin-bottom: 24px;
    line-height: 1.6;
}

.api-testing-section h3 {
    color: #0f172a;
    margin-bottom: 32px;
    border-bottom: 3px solid #1e40af;
    padding-bottom: 16px;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.api-buttons {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.api-group {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 
        0 2px 4px -1px rgba(0, 0, 0, 0.02),
        0 1px 2px -1px rgba(0, 0, 0, 0.01);
}

.api-group h4 {
    color: #0f172a;
    margin-bottom: 20px;
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group input[type="text"],
.input-group input[type="file"] {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

.api-response {
    margin-top: 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.api-response h4 {
    color: #2d3748;
    margin-bottom: 16px;
    font-weight: 600;
}

#api-response-content {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    min-height: 100px;
    color: #2d3748;
}

/* Dataset styling for topic_list.html */
.dataset-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.dataset-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dataset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #4299e1;
}

.dataset-title {
    color: #2d3748;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
}

.dataset-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 4.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.dataset-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f7fafc;
}

.dataset-kommune {
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #90cdf4;
}

.dataset-link {
    background: linear-gradient(135deg, #4299e1, #2b6cb0);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dataset-link:hover {
    background: linear-gradient(135deg, #2b6cb0, #2c5282);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.kommune-section {
    margin-bottom: 48px;
}

.kommune-section h4 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 24px;
    padding: 16px 0;
    border-bottom: 2px solid #4299e1;
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 600;
}

.kommune-count {
    background: linear-gradient(135deg, #4299e1, #2b6cb0);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hero {
  width: 100%;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

/* Downloads Section */
.downloads-section {
    margin-top: 32px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.04),
        0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.downloads-section h3 {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    border-bottom: 3px solid #1e40af;
    padding-bottom: 12px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.download-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    padding: 24px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.download-card h4 {
    color: #0f172a;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.download-links {
    list-style: none;
}

.download-links li + li {
    margin-top: 10px;
}

.download-links a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
}

.download-links a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 16px;
    border-top: 2px solid rgba(226, 232, 240, 0.8);
    color: #6b7280;
    font-size: 0.9375rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    font-weight: 500;
    letter-spacing: -0.01em;
    width: 100%;
    margin-top: auto;
}

@media (max-width: 768px) {
    body::after {
        height: 28vh;
        min-height: 180px;
        opacity: 0.9;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .commune-selector {
        min-width: auto;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-container,
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input[type="text"],
    .input-group input[type="file"] {
        min-width: auto;
        width: 100%;
    }

    .dataset-grid {
        grid-template-columns: 1fr;
    }
    
    .dataset-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (min-width: 768px) {
    .dataset-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Mobile simplified hero */
@media (max-width: 640px) {
    header.hero {
        padding: 28px 16px;
        background: #1e40af; /* solid simpler */
    }
    header.hero .hero-subtitle {
        display: none !important;
    }
    header.hero .hero-title {
        font-size: 1.9rem;
        margin-bottom: 0;
        text-shadow: none;
        letter-spacing: -0.01em;
    }
}