/* Shared styles for generated continent, country, and category pages. */

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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --bg-color: #f5f6fa;
    --card-bg: #ffffff;
    --border-color: #dfe6e9;
    --hover-color: #ecf0f1;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.header h1,
.site-brand {
    font-size: 2rem;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.continent-link {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.continent-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    width: 32px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.back-link {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--primary-color);
    border-radius: 6px;
    transition: all 0.3s;
}

.back-link:hover {
    background: var(--hover-color);
    transform: translateX(-5px);
}

.country-header-section {
    text-align: center;
    margin: 2rem 0 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.breadcrumb-nav {
    margin: 1.5rem 0 0;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    list-style: none;
    padding: 0.9rem 1.1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #5a6470;
    font-size: 0.95rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    color: #95a0aa;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    font-weight: 600;
}

.breadcrumb-item span[aria-current="page"] {
    color: var(--primary-color);
    font-weight: 700;
}

.country-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.country-header-section img {
    height: 60px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.country-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.country-description {
    margin: 0;
    max-width: 820px;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.category-subtitle {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
}

.country-context {
    margin: 0;
}

.intro-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.country-loader-intro {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.country-loader-intro h2 {
    margin: 0 0 0.85rem;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.country-loader-intro p {
    margin: 0 0 0.9rem;
    color: #444;
    line-height: 1.8;
}

.country-loader-intro p:last-child {
    margin-bottom: 0;
}

.search-panel {
    margin: 1.5rem 0 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.search-empty {
    padding: 1rem 0;
    color: #666;
    font-size: 0.98rem;
}

.top-media-section {
    margin: 3rem 0;
}

.media-type-section {
    margin-bottom: 3rem;
}

.media-type-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    font-size: 1.8rem;
    color: var(--primary-color);
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.view-all-btn:hover {
    background: var(--primary-color);
    transform: translateX(3px);
}

.top-media-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.top-media-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.top-media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.media-logo-placeholder,
.top-media-card .media-logo {
    width: min(120px, 100%);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.media-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    font-weight: 700;
}

.top-media-card .media-logo {
    object-fit: contain;
}

.top-media-card .media-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    overflow-wrap: anywhere;
}

.category-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-link {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.category-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.category-link.active {
    background: var(--accent-color);
}

.related-links-section {
    margin: 2rem 0 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.related-links-title {
    margin: 0 0 1rem;
    color: var(--primary-color);
    font-size: 1.35rem;
}

.related-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.related-link-card {
    display: block;
    padding: 1rem 1.1rem;
    background: #f7fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.related-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.08);
    border-color: var(--secondary-color);
}

.continent-title {
    margin: 2rem 0 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.country-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.country-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
}

.country-flag {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flag-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 60px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.country-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

footer a {
    color: white;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .header h1,
    .site-brand {
        font-size: 1.6rem;
    }

    .header-nav {
        gap: 1rem;
    }

    .continent-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    .top-media-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header h1,
    .site-brand {
        font-size: 1.5rem;
    }

    .hamburger {
        display: flex;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        padding: 1rem 2rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .header-nav.active {
        display: flex;
    }

    .continent-link {
        display: block;
        padding: 0.8rem 0;
        font-size: 1rem;
    }

    .country-header-section {
        padding: 1.5rem;
    }

    .country-title {
        font-size: 1.8rem;
    }

    .breadcrumb-list {
        padding: 0.85rem 0.9rem;
    }

    .country-description {
        font-size: 1rem;
    }

    .category-subtitle,
    .media-type-title {
        font-size: 1.4rem;
    }

    .media-type-title {
        flex-wrap: wrap;
        align-items: center;
    }

    .view-all-btn {
        width: auto;
        flex-shrink: 0;
        margin-left: auto;
        font-size: 0.82rem;
        padding: 0.45rem 0.7rem;
    }

    .category-nav {
        flex-direction: column;
    }

    .category-link {
        display: block;
        text-align: center;
    }

    .related-links-grid {
        grid-template-columns: 1fr;
    }

    .top-media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .top-media-card {
        padding: 1rem;
    }

    .continent-title {
        font-size: 1.8rem;
    }

    .countries-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .media-type-title {
        font-size: 1.25rem;
    }

    .view-all-btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.65rem;
    }

    .top-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .country-header-top {
        gap: 0.75rem;
    }

    .country-header-section img {
        height: 50px;
    }
}
