@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600&family=Raleway:wght@700;900&display=swap');

:root {
    /* Charter Palette */
    --primary: #004B97;
    /* Bleu Cyan Foncé */
    --background: #f5ede3;
    /* Beige Sable */
    --bg-alt: #e5f2ff;
    /* Bleu Pâle */
    --bg-card: #ffffff;
    --accent: #99ccff;
    /* Bleu Ciel */
    --text-main: #00294d;
    /* Bleu Profond (Text) */
    --text-light: #f5ede3;
    /* Beige (Text on dark) */
    --footer-bg: #00294d;
    /* Bleu Profond */

    /* Global Settings */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Functional Theme Colors (Preserved for UX distinction) */
    --color-amenagement: #004B97;
    /* Using Primary for 'Aménagement' to align with construction/structure */
    --color-citoyens: #22c55e;
    --color-communications: #a855f7;
    --color-culture: #f97316;
    --color-mobilite: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    font-family: 'Lexend', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Decoration (Wave Motif) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 0% 0%, rgba(153, 204, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 75, 151, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    padding: 1.5rem 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 75, 151, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Raleway', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-family: 'Raleway', sans-serif;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
}

.external-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-family: 'Raleway', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.external-link:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 75, 151, 0.9), rgba(0, 41, 77, 0.9)), url('../assets/hero.png');
    background-size: cover;
    background-position: center;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 4rem;
    box-shadow: 0 10px 30px -10px rgba(0, 75, 151, 0.3);
    color: white;
}

.hero h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
}

/* Grid Layouts */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.theme-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 75, 151, 0.1);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.theme-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.theme-card h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-main);
}

.theme-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--card-color);
}

.theme-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--card-color);
}

/* Data Table Styles */
.data-section {
    padding: 4rem 0;
    display: none;
    /* Controlled by JS */
}

.data-section.active {
    display: block;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(0, 75, 151, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--bg-alt);
    padding: 1.25rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(0, 75, 151, 0.1);
}

td {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(0, 75, 151, 0.05);
    vertical-align: top;
    color: var(--text-main);
}

tr:hover td {
    background: var(--bg-alt);
}

/* Filters */
.filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    background: white;
    border: 1px solid rgba(0, 75, 151, 0.2);
    color: var(--text-main);
    padding: 1rem 1rem 1rem 2.8rem;
    border-radius: 0.75rem;
    outline: none;
    transition: var(--transition);
    font-family: 'Lexend', sans-serif;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 75, 151, 0.1);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.year-tabs {
    display: flex;
    background: var(--bg-alt);
    padding: 0.25rem;
    border-radius: 0.75rem;
    gap: 0.5rem;
}

.year-tab {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
}

.year-tab:hover {
    background: rgba(255, 255, 255, 0.5);
}

.year-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 75, 151, 0.2);
}

/* Typography Helpers */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-amenagement {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-citoyens {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-communications {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.badge-culture {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.badge-mobilite {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-done {
    color: #4ade80;
    font-weight: 700;
}

.status-todo {
    color: #94a3b8;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .filters {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }
}

/* Plan Initial Styling */
.plan-content {
    background: var(--bg-card);
    padding: 4rem;
    border-radius: 1rem;
    border: 1px solid rgba(0, 75, 151, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    max-width: 900px;
    margin: 0 auto;
}

.plan-page {
    margin-bottom: 5rem;
    position: relative;
    padding-bottom: 3rem;
    border-bottom: 1px dashed rgba(0, 75, 151, 0.2);
}

.plan-page:last-child {
    border-bottom: none;
}

.plan-page::before {
    content: attr(data-page);
    position: absolute;
    top: -2rem;
    right: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.6;
    font-family: 'Raleway', sans-serif;
}

.plan-text {
    white-space: pre-wrap;
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.8;
}

.plan-text h2 {
    margin: 2rem 0 1rem;
    color: var(--accent);
}