/* 🌎 Global Title */
h1 {
    margin-top: 30px;
    color: #003366;
    text-align: center;
}

body.dark-mode h1 {
    color: white;
}

/* 🌍 Layout */
.main-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countries-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 🏳️‍🌈 Country Card Style (Enhanced Premium Look) */
.country-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 160px;
    background: linear-gradient(145deg, #f5faff, #e6f2ff);
    border: 1px solid #c8d8f0;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: #003366;
    transition: all 0.35s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 16px;
    overflow: hidden;
    position: relative;
}

/* ✨ Subtle glow & lift on hover */
.country-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.25);
    border-color: #007bff;
    background: linear-gradient(145deg, #e8f2ff, #d8eaff);
}

/* 💫 Animated border glow */
.country-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, #007bff, #00c6ff);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.country-card:hover::before {
    opacity: 1;
}

/* 🏁 Flag Image */
.country-flag {
    width: 40px;
    height: auto;
    margin-bottom: 10px;
}

/* 🌐 Country Name */
.country-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.country-card:hover h3 {
    color: #007BFF;
}

/* 🌙 Dark Mode */
body.dark-mode .country-card h3 {
    color: #ffffff;
}

body.dark-mode .country-card {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 1px solid #333;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

body.dark-mode .country-card:hover {
    background: linear-gradient(145deg, #1f1f1f, #292929);
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.3);
    border-color: #00b4ff;
}

body.dark-mode .country-card:hover h3 {
    color: #00b4ff;
}

/* 🔙 Back Button */
.back-btn-wrapper {
    margin: 25px 0;
    text-align: center;
}

.back-btn {
    display: inline-block;
    background: #007BFF;
    color: #fff;
    padding: 10px 18px;
    font-size: 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #0056b3;
}

/* 📱 Responsive Design */
@media (max-width: 900px) {
    .country-card {
        width: 45%;
    }
}

@media (max-width: 600px) {
    .country-card {
        width: 100%;
    }
}
