/* Countries Grid and Card Styles */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.country-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.country-flag {
    font-size: 2.8rem;
    line-height: 1;
}

.country-info {
    flex: 1;
}

.country-info h3 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.country-info p {
    margin: 0 0 0.6rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    line-height: 1.5;
}

.country-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.country-tags span {
    display: inline-block;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
}

.country-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.country-stats strong {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 0.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .countries-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }

    .country-flag {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .countries-grid {
        grid-template-columns: 1fr;
    }
}

/* Light mode overrides */
body:not(.dark-mode) .country-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .country-info h3 {
    color: #1e1b4b;
}

body:not(.dark-mode) .country-info p {
    color: #4b5563;
}

body:not(.dark-mode) .country-stats {
    color: #6b7280;
    border-top-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .country-tags span {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
}