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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Navigation */
nav {
    background: #f8f9fa;
    padding: 15px 30px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

nav a {
    color: #667eea;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 600;
}

nav a:hover, nav a.active {
    background: #667eea;
    color: white;
}

/* Main Content */
.content {
    padding: 30px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* View Sections */
.view-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.section-title {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.section-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Checkbox Container */
.checkbox-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.checkbox-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.95rem;
    color: #495057;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Data Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    padding: 10px 12px;
}

.country-cell, .plushie-cell {
    font-weight: 600;
    color: #667eea;
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
}

.number-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.confidence-high .confidence-badge {
    background: #d4edda;
    color: #155724;
}

.confidence-medium .confidence-badge {
    background: #fff3cd;
    color: #856404;
}

.confidence-low .confidence-badge {
    background: #d1ecf1;
    color: #0c5460;
}


/* Settings Page */
.settings-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 5px;
    margin-bottom: 10px;
}

.setting-row label {
    font-weight: 600;
    color: #495057;
}

.setting-row input {
    padding: 8px 15px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    width: 200px;
}

/* Loading Indicator */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Last Update Info */
.last-update {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .content {
        padding: 15px;
    }

    .view-section {
        padding: 15px;
    }

    .tab-navigation {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 300px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .section-title {
        font-size: 1.3rem;
    }
}
