/**
 * CuiveMedia Stats - Stylesheet
 * Statistik- und Datenportal
 */

/* Variables */
:root {
    /* Stats Colors */
    --stats-primary: #6366f1;
    --stats-primary-dark: #4f46e5;
    --stats-secondary: #8b5cf6;
    --stats-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --stats-success: #22c55e;
    --stats-danger: #ef4444;
    --stats-warning: #f59e0b;
    --stats-info: #3b82f6;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Base Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
}

/* Dark Mode */
[data-theme="dark"] {
    --stats-primary: #818cf8;
    --stats-primary-dark: #6366f1;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --border-color: #374151;
}

/* Header */
.stats-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.stats-header .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.stats-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-header .logo-img {
    height: 40px;
    width: auto;
}

.stats-badge {
    background: var(--stats-gradient);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.stats-nav {
    display: flex;
    gap: 5px;
}

.stats-nav .nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-nav .nav-item:hover,
.stats-nav .nav-item.active {
    color: var(--stats-primary);
    background: rgba(99, 102, 241, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Hero Section */
.stats-hero {
    background: var(--stats-gradient);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
}

.stats-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stats-hero .lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Category Cards */
.stats-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-category-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-color);
}

.stats-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    color: inherit;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 16px;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.category-link {
    color: var(--stats-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-link i {
    transition: transform 0.2s;
}

.stats-category-card:hover .category-link i {
    transform: translateX(4px);
}

/* Data Cards */
.data-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.data-card-header {
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.data-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-card-body {
    padding: 24px;
}

/* Chart Container */
.chart-container {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chart-wrapper {
    height: 400px;
    position: relative;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 15px;
    color: white;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 8px;
}

.stat-change.positive {
    color: var(--stats-success);
}

.stat-change.negative {
    color: var(--stats-danger);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Filter Section */
.filter-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Progress Bars */
.progress-bar-container {
    margin-bottom: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.progress-label .name {
    color: var(--text-primary);
    font-weight: 500;
}

.progress-label .value {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Election Colors */
.party-cdu { background: #000000; }
.party-spd { background: #e3000f; }
.party-gruene { background: #64a12d; }
.party-fdp { background: #ffed00; }
.party-afd { background: #009ee0; }
.party-linke { background: #be3075; }
.party-bsw { background: #73004c; }
.party-other { background: #808080; }

/* Weather Specific */
.weather-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.temperature {
    font-size: 2.5rem;
    font-weight: 700;
}

.weather-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.weather-detail:last-child {
    border-bottom: none;
}

.weather-detail i {
    width: 24px;
    color: var(--stats-primary);
}

/* Info Section */
.info-section {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin: 30px 0;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.info-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 25px 0 10px;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-section ul {
    color: var(--text-secondary);
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Footer - Explicit colors */
.stats-footer {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 50px 0 30px;
    margin-top: 50px;
}

[data-theme="dark"] .stats-footer {
    background: #111827 !important;
    border-top-color: #374151 !important;
}

.stats-footer h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 20px;
}

[data-theme="dark"] .stats-footer h5 {
    color: #f9fafb !important;
}

.footer-description {
    color: #4b5563 !important;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

[data-theme="dark"] .footer-description {
    color: #9ca3af !important;
}

.footer-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.footer-stats-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563 !important;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

[data-theme="dark"] .footer-stats-link {
    color: #9ca3af !important;
}

.footer-stats-link:hover {
    background: #ffffff;
    color: #6366f1 !important;
}

[data-theme="dark"] .footer-stats-link:hover {
    background: #1f2937;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #4b5563 !important;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

[data-theme="dark"] .footer-links a {
    color: #9ca3af !important;
}

.footer-links a:hover {
    color: #6366f1 !important;
}

.stats-disclaimer {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 30px 0;
}

.stats-disclaimer p {
    color: #4b5563 !important;
    font-size: 0.85rem;
    margin: 0;
}

[data-theme="dark"] .stats-disclaimer p {
    color: #d1d5db !important;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb !important;
    padding-top: 25px;
    margin-top: 30px;
}

[data-theme="dark"] .footer-bottom {
    border-top-color: #374151 !important;
}

.copyright-text {
    color: #6b7280 !important;
    font-size: 0.9rem;
    margin: 0;
}

[data-theme="dark"] .copyright-text {
    color: #9ca3af !important;
}

.footer-social {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.footer-social a {
    color: #6b7280 !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

[data-theme="dark"] .footer-social a {
    color: #9ca3af !important;
    background: #1f2937 !important;
}

.footer-social a:hover {
    background: #6366f1 !important;
    color: white !important;
}

/* Ad Container */
.ad-container {
    margin: 30px 0;
    text-align: center;
}

/* Loading */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--stats-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 992px) {
    .stats-hero h1 {
        font-size: 1.75rem;
    }

    .chart-wrapper {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .stats-header .header-center {
        display: none;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-hero {
        padding: 30px 0;
    }

    .chart-wrapper {
        height: 250px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
