/* Universal Box-Sizing & Modern Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette */
    --color-primary: #008080;
    --color-secondary: #006666;
    --color-accent: #FFD700;
    --color-dark: #2c3e50;
    --color-light: #f8f9fa;
    --color-white: #FFFFFF;
    --color-gray: #DCDCDC;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Spacing */
    --spacing-md: 20px;
    --spacing-lg: 40px;
    --spacing-xl: 80px;

    /* Transitions */
    --transition-fast: all 0.2s ease-in-out;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- General Layout & Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

section {
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--color-dark);
}

.section-title {
    font-size: 2.5em;
    margin-bottom: var(--spacing-lg);
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 0;
    height: 4px;
    background-color: var(--color-primary);
    margin: 10px auto 0;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.section:hover .section-title::after {
    width: 80px;
}

.section-description {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    color: #666;
}

/* --- Buttons (CTAs) --- */
.cta-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.primary-cta {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
}
.primary-cta:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 128, 128, 0.35);
}
.secondary-cta {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.secondary-cta:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 128, 128, 0.2);
}

/* --- Header & Navigation --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    transition: var(--transition-smooth);
    /* ✨ FIX: Add flex properties directly to the navbar */
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    height: 80px;
}

.navbar.scrolled {
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

/* ✨ NEW: Styling for the image logo */
.logo img {
    height: 40px; /* Adjust size as needed */
    width: auto;
    display: block;
    transition: var(--transition-fast);
}
.logo a:hover img {
    transform: scale(1.05); /* Slight zoom on hover */
    opacity: 0.9;
}


.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-links a {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: var(--transition-fast);
    position: relative;
    text-transform: uppercase;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-links a:hover::after { width: 100%; }

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1002;
    background: none;
    border: none;
}
.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }


/* --- Hero Section --- */
.main-header {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    color: var(--color-white);
    overflow: hidden;
    padding: 120px 0 160px 0;
}

@keyframes panImage {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.hero-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1539650116574-75c0c6d5bf37?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    opacity: 0.2;
    z-index: -2;
    animation: panImage 40s infinite linear alternate;
}

.hero-background-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.85), rgba(0, 102, 102, 0.9));
    z-index: -1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.hero-text { text-align: left; }
.hero-headline {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--color-white);
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.hero-subheadline {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
}

.hero-image { display: flex; justify-content: center; align-items: center; }
.tunisia-hero-image {
    width: 100%;
    height: auto;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.4s ease;
}
.tunisia-hero-image:hover { transform: scale(1.05) rotate(1deg); }

/* --- Map Section --- */
.map-section {
    background-color: var(--color-light);
    padding: var(--spacing-lg) 0 var(--spacing-xl) 0;
    margin-top: -120px;
    position: relative;
    z-index: 2;
}
#map-container {
    width: 100%;
    max-width: 900px; /* Adjust max-width as needed */
    margin: 0 auto;
    overflow: hidden; /* Hide overflow for panzoom */
    cursor: grab;
}

#tunisia-map-svg {
    width: 100%;
    height: auto;
}

/* Make labels smaller on mobile devices */
@media (max-width: 768px) {
    .gov-label {
        font-size: 10px;
    }
}

#features path {
    fill: #eceff1; /* Updated "Coming Soon" color */
    stroke: var(--color-light);
    stroke-width: 1.5;
    transition: var(--transition-fast);
    cursor: pointer;
}
#features path.hovered-governorate {
    fill: var(--color-primary);
    transform: translateY(-1px);
}

.gov-label {
    font-family: var(--font-body);
    font-size: 14px;
    fill: black;
    text-anchor: middle;
    /* keep pointer events so tooltips still work (mouse handlers are added in JS) */
    user-select: none;
    font-weight: 600;
    transition: var(--transition-fast);
}
.gov-label.hovered-label {
    fill: var(--color-white);
}

/* --- Tooltip Styles --- */
#map-tooltip {
    position: fixed;
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 1rem;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
#map-tooltip:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- About & CTA Sections --- */
.about-section {
    background-color: var(--color-dark);
    color: var(--color-light);
}
.about-section .section-title { color: var(--color-white); }
.about-section .section-title::after { background-color: var(--color-accent); }
.about-section p { color: rgba(255, 255, 255, 0.8); max-width: 700px; margin-left: auto; margin-right: auto; }

.youtube-cta {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
}
.youtube-cta .section-title { color: var(--color-white); }
.youtube-cta .section-title::after { background-color: var(--color-accent); }
.youtube-cta .section-description { color: rgba(255, 255, 255, 0.9); }

/* --- Footer --- */
.main-footer {
    background-color: #222;
    color: #ccc;
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}
.disabled {
    cursor: not-allowed;
}
.footer-logo { font-family: var(--font-heading); font-size: 1.5em; color: var(--color-white); }
.footer-nav { list-style: none; display: flex; gap: var(--spacing-md); }
.footer-nav a, .social-links a { color: #bbb; text-decoration: none; transition: var(--transition-fast); }
.footer-nav a:hover, .social-links a:hover { color: var(--color-primary); }
.copyright {
    width: 100%;
    text-align: center;
    margin-top: var(--spacing-lg);
    border-top: 1px solid #444;
    padding-top: var(--spacing-md);
    font-size: 0.9rem; color: #888;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-text { text-align: center; order: 2; margin-top: 20px;}
    .hero-image { order: 1; }
    .hero-headline { font-size: 3rem; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .mobile-menu-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 0; right: -100%; width: 70%;
        height: 100vh;
        background: rgba(10, 25, 47, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 1.2rem; }
    .section-title { font-size: 2em; }
}

@media (max-width: 480px) {
    .navbar { height: 70px; }
    .hero-headline { font-size: 2.2rem; }
    .hero-subheadline { font-size: 1rem; }
    .section-title { font-size: 1.8em; }
}
/* --- Map Legend --- */
#map-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
    max-width: max-content;
    margin-left: auto;
    margin-right: auto;
}

#label_points text,
#label_points circle {
    pointer-events: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-text {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}
/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--color-light); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; border: 2px solid var(--color-light); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray); }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray) var(--color-light);
}
