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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 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: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    text-align: center;
}

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

.subtitle {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.update-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.update-info span {
    color: #888;
    font-size: 0.9em;
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.country-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.country-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #f0f0f0;
}

.country-header h2 {
    font-size: 1.5em;
    color: #333;
}

.trend-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.trends-list {
    margin-bottom: 20px;
}

.trend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s;
}

.trend-item:hover {
    background: #e9ecef;
}

.trend-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    margin-right: 15px;
    flex-shrink: 0;
}

.trend-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trend-text {
    color: #333;
    font-size: 1em;
    font-weight: 600;
    word-break: break-word;
}

.trend-volume {
    color: #888;
    font-size: 0.85em;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.view-more, .source-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.view-more:hover, .source-link:hover {
    color: #764ba2;
}

.source-link {
    font-size: 0.85em;
    color: #888;
}

footer {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: #666;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    color: #764ba2;
}

/* Country Detail Page Styles */
.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #764ba2;
}

.country-detail {
    margin-bottom: 30px;
}

.detail-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.detail-card h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.trends-list-detailed {
    max-width: 800px;
    margin: 0 auto;
}

.trend-item-detailed {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s;
}

.trend-item-detailed:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(5px);
}

.trend-rank {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 20px;
    flex-shrink: 0;
}

.trend-text-large {
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
    word-break: break-word;
    display: block;
    margin-bottom: 5px;
}

.trend-volume-large {
    color: #888;
    font-size: 0.95em;
    display: block;
}

.source-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin: 20px auto 0;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.source-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .countries-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .country-header h2 {
        font-size: 1.3em;
    }
    
    .update-info {
        flex-direction: column;
        gap: 10px;
    }
}
