/* TopRanker - Main Stylesheet */

:root {
    --primary-green: #2ecc40;
    --dark-green: #27ae60;
    --bg-cream: #fdf6f0;
    --bg-light: #f8f9fa;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background: #fff;
}

/* Navbar */
.brand-text {
    font-size: 1.3rem;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar .nav-link.active {
    color: var(--dark-green) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,0,0,0.3)), 
                url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=1600') center/cover no-repeat;
    min-height: 500px;
    display: flex;
    align-items: center;
    color: white;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-section h1 span {
    color: var(--primary-green);
}

.hero-section p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 500px;
}

/* Hero Carousel */
.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Stats Section */
.stats-section {
    padding: 60px 0;
}

.stats-section .stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.green { background: #e8f5e9; color: var(--dark-green); }
.stat-card .stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-card .stat-icon.orange { background: #fff3e0; color: #f57c00; }

.stat-card h3 {
    font-weight: 700;
    margin: 0;
}

.stat-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Featured Sections */
.featured-section {
    background: var(--bg-cream);
    padding: 60px 0;
}

.featured-section .section-label {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: var(--dark-green);
}

.category-card .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.category-card h6 {
    font-weight: 600;
    margin: 0;
}

/* Map Section */
.map-section {
    padding: 60px 0;
}

.map-container {
    background: var(--bg-cream);
    border-radius: 16px;
    padding: 30px;
}

#world-map {
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
}

.map-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.legend-gradient {
    width: 200px;
    height: 15px;
    border-radius: 8px;
    background: linear-gradient(to right, #85144b, #ff4136, #ff851b, #ffdc00, #2ecc40);
}

/* Index Page */
.index-header {
    background: var(--bg-cream);
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 30px;
}

.index-header h3 {
    font-weight: 700;
    margin: 0;
}

/* Ranking Table */
.ranking-table {
    background: var(--bg-cream);
    border-radius: 16px;
    padding: 30px;
}

.ranking-table table {
    margin: 0;
}

.ranking-table th {
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.ranking-table th:hover {
    color: var(--dark-green);
}

.ranking-table th .sort-icon {
    font-size: 0.7rem;
    margin-left: 5px;
    opacity: 0.3;
}

.ranking-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--dark-green);
}

.ranking-table td {
    vertical-align: middle;
    padding: 12px 8px;
}

.ranking-table .country-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-table .country-cell img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
}

.grade-value {
    color: var(--dark-green);
    font-weight: 600;
}

/* News Section */
.news-section {
    padding: 60px 0;
}

.news-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Country Detail */
.country-header {
    background: var(--bg-cream);
    padding: 40px 0;
}

.country-header .flag-large {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 20px;
}

.detail-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.detail-card .card-header {
    background: var(--bg-cream);
    font-weight: 600;
    border-bottom: none;
}

/* Popular Section */
.popular-section {
    background: var(--bg-light);
    padding: 60px 0;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text-dark);
}

.popular-item:hover {
    background: #f0f9f0;
    color: var(--dark-green);
}

.popular-item img {
    width: 32px;
    height: 24px;
    border-radius: 3px;
}

/* Search Page */
.search-results .result-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.search-results .result-item:hover {
    background: #f8f9fa;
}

/* Login Page */
.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
    border: none;
    border-radius: 16px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

/* World map styles */
.leaflet-container {
    background: #fdf6f0 !important;
}

.leaflet-tooltip {
    background: rgba(255, 255, 255, 0.96) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.82rem !important;
    color: #333 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
}

.leaflet-tooltip::before {
    display: none !important;
}

.map-info-panel {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-info-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.map-info-detail {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.6;
}

.map-info-hint {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* Static page */
.static-page {
    padding: 60px 0;
    min-height: 50vh;
}

/* 404 */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-green);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section {
        min-height: 350px;
    }
    
    #world-map {
        height: 300px;
    }
    
    .stat-card {
        justify-content: center;
        margin-bottom: 20px;
    }
}

/* Pagination */
.pagination .page-link {
    color: var(--dark-green);
}

.pagination .page-item.active .page-link {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Sort indicators */
.sort-asc::after { content: ' ▲'; font-size: 0.7em; }
.sort-desc::after { content: ' ▼'; font-size: 0.7em; }
