/* ======================================= */
/* 1. Global Styles & Variables            */
/* ======================================= */
:root {
    --primary-color: #005A9C; /* Standard site color */
    --secondary-color: #00A4E4; /* Standard site color */
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #333;
    --label-color: #555;
    --border-color: #e0e0e0;
    --dark-footer-bg: #1a202c;
    --light-text: #f0f4f8;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body { 
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color); 
    color: var(--text-color); 
    margin: 0; 
}

/* ======================================= */
/* 2. Main Site Header (Navigation)        */
/* ======================================= */
.site-header {
    background: var(--card-background);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1400px; /* Wider for this page */
    margin: 0 auto;
}

.site-title a { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo { height: 45px; width: auto; }
.logo-text { font-family: 'Inter', sans-serif; font-size: 1.4em; font-weight: 700; color: var(--primary-color); }

.site-nav a {
    margin-left: 25px;
    font-weight: 600;
    color: var(--label-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--primary-color); }

/* ======================================= */
/* 3. Page-Specific Hero Section (Title)   */
/* ======================================= */
.page-hero {
    background-color: #eaf2f8;
    text-align: center;
    padding: 40px 20px;
}

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

.page-hero h1 { 
    color: var(--primary-color); 
    margin: 0 0 10px 0;
    font-size: 2.5rem;
}
.page-hero p { color: var(--label-color); font-size: 1.1em; margin: 0; }

/* ======================================= */
/* 4. Main Content Wrapper & Original Styles */
/* ======================================= */
.page-content-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
}

.filters { display: flex; justify-content: center; gap: 20px; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; }
.filter-group label { margin-bottom: 5px; font-size: 0.9rem; color: #555; }

#letterInput, #continentSelect {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 250px;
    transition: all 0.3s ease;
}
#letterInput:focus, #continentSelect:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 8px rgba(0, 123, 255, 0.2); }

#results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; min-height: 400px; }
.country-card { background: var(--card-bg); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; opacity: 0; animation: fadeIn 0.5s forwards; }
.country-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
@keyframes fadeIn { to { opacity: 1; } }

.card-flag { width: 100%; height: 180px; background-color: #e9ecef; display: flex; justify-content: center; align-items: center; font-size: 6rem; }
.card-body { padding: 20px; }
.card-body h2 { margin: 0 0 15px 0; font-size: 1.5rem; }
.card-body p { margin: 0 0 8px 0; font-size: 1rem; color: #555; }
.card-body p strong { color: var(--text-color); }

#no-results { text-align: center; font-size: 1.2rem; color: #888; padding: 2rem; }
.hidden { display: none; }

/* Pagination Styles */
#pagination-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2rem 0; }
.pagination-btn { border: 2px solid #ddd; background-color: #fff; color: var(--primary-color); font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.pagination-btn:hover { background-color: #f4f7f9; border-color: #ccc; }
.pagination-btn.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* Content Section Styles */
.content-container { width: 100%; margin-top: 3rem; padding: 2.5rem; background-color: var(--card-bg); border-radius: 12px; box-shadow: var(--shadow); box-sizing: border-box; }
.content-title { text-align: center; font-size: 2rem; color: var(--primary-color); margin-top: 0; margin-bottom: 1rem; }
.content-intro { text-align: center; max-width: 800px; margin: 0 auto 3rem auto; color: #555; font-size: 1.1rem; }
.continent-section { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid #e9ecef; }
.continent-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.continent-section h3 { font-size: 1.75rem; margin-top: 0; margin-bottom: 1rem; color: var(--text-color); }
.continent-section p { line-height: 1.7; margin-bottom: 1.5rem; }
.trivia-list { list-style: none; padding: 0; }
.trivia-list li { padding: 8px 0; border-bottom: 1px solid #f1f1f1; }
.trivia-list li:last-child { border-bottom: none; }
.trivia-list strong { color: var(--primary-color); }


/* ======================================= */
/* 5. Main Site Footer                     */
/* ======================================= */
.site-footer {
    background: var(--dark-footer-bg);
    color: var(--light-text);
    padding: 30px 0;
    margin-top: 50px;
    width: 100%;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-nav a {
    margin-left: 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-nav a:hover {
    color: white;
}