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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.last-updated {
    color: #666;
    font-size: 0.95em;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auto-refresh label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95em;
    color: #666;
}

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

#intervalSlider {
    width: 150px;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.5em;
    color: white;
    display: none;
}

.loading.active {
    display: block;
}

.trends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.country-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.country-section h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.trends-grid {
    display: grid;
    gap: 15px;
}

.trend-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

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

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-left-color: #764ba2;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.trend-title-link {
    flex: 1;
    margin-right: 15px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-title-link:hover .trend-title {
    color: #667eea;
}

.trend-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    transition: color 0.2s ease;
}

.trend-title-link::after {
    content: "🔗";
    opacity: 0;
    font-size: 0.9em;
    transition: opacity 0.2s ease;
}

.trend-title-link:hover::after {
    opacity: 1;
}

.trend-volume {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    white-space: nowrap;
}

.trend-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 8px;
}

.status-active {
    background: #10b981;
    color: white;
}

.status-lasted {
    background: #f59e0b;
    color: white;
}

.trend-time {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.trend-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.breakdown-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.breakdown-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breakdown-query {
    background: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.breakdown-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.breakdown-query:hover,
.breakdown-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.demo-mode {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    margin: 20px auto 30px;
    max-width: 800px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .trends-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .header-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .trend-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .trend-volume {
        align-self: flex-start;
    }
}

