/* German Weather Quality Tracker - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0e17;
    --bg-card: rgba(22, 30, 46, 0.7);
    --bg-card-hover: rgba(30, 42, 64, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #38bdf8;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, .font-heading {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header & Navbar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-glow);
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Hero Quick Stats Grid */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-blue);
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-detail {
    font-size: 0.85rem;
    color: var(--accent-green);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Controls / Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.pill-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.pill-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-btn.active {
    background: var(--accent-blue);
    color: #000000;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

/* Leaderboard Grid */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.rank-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    transition: all 0.25 ease;
    backdrop-filter: blur(10px);
}

.rank-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.rank-card.top-1 {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-badge-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.provider-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.medal-badge {
    font-size: 1.5rem;
}

.grade-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.grade-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.grade-txt {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.metrics-list {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.metric-item {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
}

.metric-item .val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.metric-item .sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

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

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* Matrix Table Section */
.matrix-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.table-responsive {
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.matrix-table th {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.9rem 1.2rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.matrix-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.matrix-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.matrix-table tr.row-actual {
    background: rgba(56, 189, 248, 0.08);
    font-weight: 700;
}

.matrix-table tr.row-actual td {
    border-top: 2px solid var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
}

.diff-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

.diff-tag.accurate {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.diff-tag.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #1e293b;
    color: #ffffff;
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Management / Dev Tools Container */
#dev-tools-container {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.25s ease-out;
}

.dev-tools-hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Optimization & Responsive Styling (Galaxy S25 / Smartphones) */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.85rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    .brand {
        gap: 0.75rem;
    }

    .brand h1 {
        font-size: 1.35rem;
    }

    .brand-subtitle {
        font-size: 0.8rem;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #dev-tools-container {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    #dev-tools-container .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1rem 0.85rem;
        border-radius: var(--radius-md);
    }

    .stat-val {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .filter-bar {
        padding: 0.85rem 0.9rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        width: 100%;
    }

    .pill-group {
        width: 100%;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 3px;
        gap: 3px;
    }

    .pill-group::-webkit-scrollbar {
        display: none;
    }

    .pill-btn {
        flex: 1 0 auto;
        padding: 0.45rem 0.7rem;
        font-size: 0.8rem;
        white-space: nowrap;
        text-align: center;
    }

    .leaderboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .rank-card {
        padding: 1.15rem;
    }

    .grade-badge {
        width: 58px;
        height: 58px;
    }

    .grade-num {
        font-size: 1.3rem;
    }

    .metrics-list {
        gap: 0.5rem;
    }

    .metric-item {
        padding: 0.55rem 0.65rem;
    }

    .metric-item .val {
        font-size: 0.95rem;
    }

    .metric-item .sub {
        font-size: 0.7rem;
    }

    .charts-grid {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .matrix-card {
        padding: 1rem 0.85rem;
    }

    .matrix-table th, .matrix-table td {
        padding: 0.75rem 0.6rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .btn {
        padding: 0.55rem 0.95rem;
        font-size: 0.85rem;
        touch-action: manipulation;
    }

    .btn:active {
        transform: scale(0.97);
    }
}

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

    .header-actions {
        flex-direction: row;
        justify-content: space-between;
    }
}
