/* ==========================================
   static/css/style.css
   Style complet pour Djerba Citoyenne
   ========================================== */

/* Variables CSS */
:root {
    --bg-primary: #f0f9ff;
    --bg-secondary: #e0f2fe;
    --text-primary: #0d1b2a;
    --text-secondary: #1b263b;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(14, 165, 233, 0.3);
    --text-shadow: 0 1px 4px rgba(255, 255, 255, 1), 0 0 8px rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --card-bg: rgba(15, 23, 42, 0.75);
    --card-border: rgba(56, 189, 248, 0.3);
    --text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}



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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    background: var(--bg-primary);
    transition: background 0.3s ease, color 0.3s ease;
}



/* Background Animation - WebP with PNG fallback */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* PNG fallback for browsers without WebP support */
    background: url('../images/bg-dark.png') no-repeat center center/cover;
    transition: background-image 0.5s ease;
}

/* WebP support - 92% smaller file size! */
@supports (background-image: url('data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=')) {
    .bg-animation {
        background: url('../images/bg-dark.webp') no-repeat center center/cover;
    }

    [data-theme="light"] .bg-animation {
        background: url('../images/bg-light.png') no-repeat center center/cover;
    }
}

/* PNG fallback for light theme */
[data-theme="light"] .bg-animation {
    background: url('../images/bg-light.png') no-repeat center center/cover;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    /* No overlay in either mode */
}



/* Stars */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

/* Removed - show stars in both modes */
[data-theme="light"] .star {
    display: none;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Waves */
.waves {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="rgba(0,200,255,0.3)"/></svg>') repeat-x;
    animation: wave 15s linear infinite;
}

.wave:nth-child(2) {
    animation: wave 20s linear infinite reverse;
    opacity: 0.7;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Removed - show waves in both modes */
/* [data-theme="light"] .waves {
    display: none;
} */

/* Sea Breeze Animation (Option A) */
.birds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: block;
    /* Show in both modes */
    pointer-events: none;
}

/* Removed - birds now show in both modes */
/* [data-theme="light"] .birds {
    display: block;
} */

.bird {
    position: absolute;
    width: 50px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'%3E%3Cpath d='M25,10 Q15,-5 0,10 Q10,10 25,15 Q40,10 50,10 Q35,-5 25,10 Z' fill='rgba(255, 255, 255, 0.8)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.8;
}

/* Bird 1: High and slow */
.bird-1 {
    top: 15%;
    left: -10%;
    animation: flyBird 25s linear infinite;
    transform: scale(0.8);
}

/* Bird 2: Mid-height and faster */
.bird-2 {
    top: 30%;
    left: -10%;
    animation: flyBird 20s linear infinite;
    animation-delay: 5s;
    transform: scale(0.6);
}

/* Bird 3: Distance, very slow */
.bird-3 {
    top: 10%;
    left: -10%;
    animation: flyBird 35s linear infinite;
    animation-delay: 10s;
    transform: scale(0.4);
}

@keyframes flyBird {
    0% {
        transform: translateX(-100px) translateY(0) scale(var(--scale, 1));
    }

    25% {
        transform: translateX(30vw) translateY(20px) scale(var(--scale, 1));
    }

    50% {
        transform: translateX(60vw) translateY(-10px) scale(var(--scale, 1));
    }

    75% {
        transform: translateX(90vw) translateY(10px) scale(var(--scale, 1));
    }

    100% {
        transform: translateX(120vw) translateY(0) scale(var(--scale, 1));
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 2rem;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.6);
}

.theme-toggle:hover {
    transform: scale(1.15);
}

.theme-toggle:focus {
    outline: 3px solid #00d4ff;
    outline-offset: 4px;
}

.theme-toggle:focus:not(:focus-visible) {
    outline: none;
}

.theme-toggle-icon {
    font-size: 2rem;
}

/* ── Navigation ── */
nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1400px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 0 1.5rem;
    border-radius: 22px;
    z-index: 1000;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    height: 62px;
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(14, 165, 233, 0.2);
}

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

/* Primary nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    list-style: none;
    flex: 1;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
    position: relative;
    white-space: nowrap;
}

[data-theme="light"] .nav-link {
    color: rgba(15, 23, 42, 0.75);
}

.nav-link:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.08);
}

/* Active link underline dot */
.nav-link.active {
    color: #00d4ff;
    font-weight: 700;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #00d4ff;
}

/* nav-right: language + divider + user actions */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Vertical divider */
.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

/* Language selector */
.nav-lang-wrap {
    position: relative;
}

.nav-lang-select-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-lang-select-wrap:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.nav-lang-icon {
    font-size: 0.95rem;
}

.nav-lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 2px;
}

[data-theme="light"] .nav-lang-select {
    color: rgba(15, 23, 42, 0.85);
}

.nav-lang-select option {
    background: #0f172a;
    color: white;
}

.nav-lang-arrow {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* User action group */
.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Notification bell */
.nav-notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-notif-btn:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.3);
}

/* Notification badge */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid rgba(15, 23, 42, 0.8);
}

/* Avatar link */
.nav-avatar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-avatar-link:hover,
.nav-avatar-link.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.35);
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-avatar-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="light"] .nav-avatar-name {
    color: rgba(15, 23, 42, 0.85);
}

/* The desktop nav is a fixed-height single row capped at 1400px — with 7
   nav links plus the language switcher, notif bell, avatar and logout
   button, the username text is what pushes it into overflow (confirmed:
   ~65px over at any desktop width, since the 1400px cap never relaxes).
   Dropped only here; the mobile dropdown (media query below) has vertical
   room to spare so it keeps showing it. */
@media (min-width: 769px) {
    .nav-avatar-name {
        display: none;
    }
}

/* Logout button */
.nav-logout-btn {
    padding: 0.4rem 1rem;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #e74c3c;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-logout-btn:hover {
    background: rgba(231, 76, 60, 0.28);
    border-color: rgba(231, 76, 60, 0.6);
    transform: translateY(-1px);
}

/* Login CTA */
.btn-nav-login {
    display: inline-block;
    padding: 0.45rem 1.2rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white !important;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-nav-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 212, 255, 0.5);
}

/* User action link fallback (unauthenticated register link) */
.nav-user-actions .nav-link {
    font-size: 0.85rem;
}



.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-shrink: 0;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 10px;
}

.nav-links a:hover {
    color: #00d4ff;
}

.btn-nav-login {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-nav-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

/* User action group on the right side of the navbar */
.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.3rem 0.5rem;
}

.nav-user-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.nav-user-link:hover {
    background: rgba(0, 212, 255, 0.12);
    color: #00d4ff;
}

/* Notification badge bubble */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    vertical-align: super;
    margin-left: 2px;
    line-height: 1;
}

/* Messages Django */
.messages-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    width: 90%;
    max-width: 600px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: 100px;
    /* Ajout d'un padding uniforme */
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    margin-top: 0;
    /* Pas de margin supplémentaire */
}

.hero-content {
    max-width: 1000px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #ff006e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}



.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white;
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 212, 255, 0.6);
}

.btn-secondary {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    transform: translateY(-5px);
}

/* Features Section */
.features {
    padding: 3rem 2rem;
}

.features-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 25px;
    border: 1px solid var(--card-border);
    transition: all 0.5s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #00d4ff, #0096ff);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.feature-card:nth-child(2) .feature-icon {
    background: linear-gradient(135deg, #ff006e, #ff6496);
    box-shadow: 0 10px 30px rgba(255, 0, 110, 0.4);
}

.feature-card:nth-child(3) .feature-icon {
    background: linear-gradient(135deg, #7b2ff7, #c864ff);
    box-shadow: 0 10px 30px rgba(123, 47, 247, 0.4);
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* News Section */
.news {
    padding: 3rem 2rem;
}

.news-container {
    max-width: 1400px;
    margin: 0 auto;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.news-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: all 0.4s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
}

.news-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #00d4ff, #0096ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.news-card:nth-child(2) .news-image {
    background: linear-gradient(135deg, #ff006e, #ff6496);
}

.news-card:nth-child(3) .news-image {
    background: linear-gradient(135deg, #7b2ff7, #c864ff);
}

.news-content {
    padding: 2rem;
}

.news-date {
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.news-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
footer {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--card-border);
    padding: 3rem 2rem;
    z-index: 1;
    text-align: center;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .theme-toggle {
        top: 90px;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
}

/* Utility Classes */
.bg-light {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.bg-dark {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}


/* Pages (Signalement, Vote, Actualités) */
.signalement-page,
.vote-page,
.actualites-page {
    padding: 2rem;
    /* PAS de padding-top énorme */
    min-height: calc(100vh - 100px);
}

.signalement-container,
.vote-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 4rem;
}

.signalement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-card,
.reports-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
}

.form-card h2,
.reports-card h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
}

/* The native <option> popup ignores the select's translucent background,
   so without an explicit solid background it falls back to the browser
   default (light) while the text stays --text-primary (near-white in dark
   mode) — invisible until hovered. */
.form-group option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.btn-full {
    width: 100%;
}

.reports-list {
    max-height: 600px;
    overflow-y: auto;
}

.report-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.report-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.report-badge {
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-urgent {
    background: #ef4444;
}

.badge-eleve {
    background: #f97316;
}

.badge-moyen {
    background: #eab308;
}

.badge-faible {
    background: #10b981;
}

.report-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.report-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.status-pending {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-resolved {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* ==========================================
   VOTES DASHBOARD & MASONRY
   ========================================== */

/* Dashboard Stats Row */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-box {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-chart-mini {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    display: flex;
    gap: 4px;
    align-items: flex-end;
    opacity: 0.5;
}

.chart-bar {
    width: 6px;
    background: #00d4ff;
    border-radius: 3px;
}

.chart-line {
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 2px;
}

/* Section Title Small */
.section-title-small {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-left: 4px solid #00d4ff;
    padding-left: 1rem;
}

/* Masonry Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    grid-auto-rows: min-content;
    /* Important for masonry-like effect with JS, or just auto sizing */
    gap: 1.5rem;
    align-items: start;
    /* Prevents stretching */
}

/* Featured Item - Spans 2 columns if space allows */
@media (min-width: 1100px) {
    .masonry-item.featured-item {
        grid-column: span 2;
    }
}

.masonry-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Compact Poll Styles */
.poll-option.compact {
    margin-bottom: 0.5rem;
}

.poll-option.compact label {
    margin-bottom: 0;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}


.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.municipality-badge.compact {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.8rem;
}

.poll-votes-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Closed Item Specifics */
.closed-item {
    opacity: 0.85;
    background: rgba(var(--card-bg), 0.5);
}

.poll-result-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.top-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-weight: 600;
}

.winner-star {
    font-size: 1.2rem;
}


.poll-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
}

.poll-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.poll-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.poll-badge.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.poll-badge.closed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.poll-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.poll-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.poll-option {
    margin-bottom: 1rem;
}

.poll-option input[type="radio"] {
    display: none;
}

.poll-option label {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.poll-option input[type="radio"]:checked+label {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
}

.option-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.option-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    transition: width 0.5s ease;
}

.poll-form {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.poll-options {
    flex-grow: 1;
}

.poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

@media (max-width: 768px) {

    .signalement-grid,
    .vote-grid {
        grid-template-columns: 1fr;
    }
}

/* Page Actualités */
.actualites-page {
    padding: 10rem 2rem 4rem;
    min-height: 100vh;
}

.actualites-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Filtres */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white;
    border-color: transparent;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.6rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-primary);
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #00d4ff;
}

.search-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
}

/* Breaking News */
.breaking-section {
    margin-bottom: 4rem;
}

.breaking-title {
    color: #ef4444;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breaking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.breaking-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 2px solid #ef4444;
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.breaking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: #ef4444;
}

.breaking-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.breaking-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.breaking-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.breaking-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Grille d'actualités */
.actualites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.actualite-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.actualite-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
}

.actualite-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.actualite-emoji {
    font-size: 4rem;
}

.actualite-content {
    padding: 1.5rem;
}

.actualite-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.actualite-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.actualite-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.actualite-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.actualite-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.actualite-author {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-read-more {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-read-more:hover {
    transform: translateX(5px);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.8rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white;
    transform: translateY(-2px);
}

.pagination-info {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .magazine-layout {
        grid-template-columns: 1fr;
    }

    .magazine-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   NEWS MAGAZINE LAYOUT
   ========================================== */

/* Breaking Ticker */
.breaking-ticker-container {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0.8rem 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.ticker-label {
    background: #ef4444;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-right: 1rem;
    flex-shrink: 0;
    z-index: 2;
}

.breaking-ticker {
    display: flex;
    animation: tickerSlide 30s linear infinite;
    gap: 3rem;
    white-space: nowrap;
}

@keyframes tickerSlide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.ticker-item {
    color: var(--text-primary);
    font-weight: 500;
}

.ticker-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Layout Grid */
.magazine-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* Hero Article */
.news-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 3rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.news-hero-image {
    height: 400px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-emoji {
    font-size: 8rem;
    opacity: 0.8;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
}

.news-hero-content {
    padding: 2.5rem;
    margin-top: -100px;
    position: relative;
    z-index: 2;
}

.hero-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.category-tag {
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.news-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

[data-theme="light"] .news-hero h2 {
    background: linear-gradient(135deg, #0d1b2a, #1b263b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    max-width: 80%;
}

/* Magazine Grid (Secondary Items) */
.magazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.magazine-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: transform 0.3s ease;
}

.magazine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.magazine-card-image {
    height: 180px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(123, 47, 247, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-emoji {
    font-size: 3rem;
}

.magazine-card-content {
    padding: 1.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.category-text {
    font-weight: 700;
    text-transform: uppercase;
}

.date-text {
    color: var(--text-secondary);
}

.magazine-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.magazine-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more-link {
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-form-sidebar {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.5rem;
    border: 1px solid var(--card-border);
}

.search-form-sidebar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    flex: 1;
    padding: 0.5rem;
    outline: none;
}

.search-form-sidebar button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid #00d4ff;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.category-item:hover,
.category-item.active {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
}

.trending-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.trending-number {
    font-size: 2rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.trending-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.trending-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Filtres Municipalités */
.municipalites-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.muni-btn {
    padding: 0.8rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.muni-btn:hover,
.muni-btn.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    transform: translateY(-2px);
}

/* ==========================================
   MUNICIPALITIES SECTION
   Modern gradient cards inspired by reference design
   ========================================== */

/* Municipalities Hero */
.municipalities-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.municipalities-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(123, 47, 247, 0.15) 0%, transparent 50%);
    z-index: -1;
}

.gradient-text {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #ff006e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Municipalities Grid - Dark Theme Cards */
.municipalities-section {
    padding: 4rem 2rem;
}

.municipalities-container {
    max-width: 1400px;
    margin: 0 auto;
}

.municipalities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.municipality-card {
    position: relative;
    height: 500px;
    border-radius: 30px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.municipality-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 212, 255, 0.4);
}

.municipality-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.municipality-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.municipality-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease;
}

.municipality-card[data-municipality="houmt-souk"] .municipality-gradient {
    background: linear-gradient(180deg,
            rgba(0, 212, 255, 0.7) 0%,
            rgba(123, 47, 247, 0.8) 50%,
            rgba(255, 0, 110, 0.9) 100%);
}

.municipality-card[data-municipality="midoun"] .municipality-gradient {
    background: linear-gradient(180deg,
            rgba(123, 47, 247, 0.7) 0%,
            rgba(200, 100, 255, 0.8) 50%,
            rgba(255, 153, 0, 0.9) 100%);
}

.municipality-card[data-municipality="ajim"] .municipality-gradient {
    background: linear-gradient(180deg,
            rgba(255, 0, 110, 0.7) 0%,
            rgba(255, 100, 150, 0.8) 50%,
            rgba(255, 153, 0, 0.9) 100%);
}

.municipality-card:hover .municipality-gradient {
    opacity: 0.85;
}

.municipality-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    color: white;
    z-index: 10;
}

.municipality-card-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.municipality-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.btn-discover {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-discover:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

/* Light Theme Info Cards */
.municipalities-info-section {
    padding: 6rem 2rem;
    background: rgba(255, 255, 255, 0.02);
}



.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 25px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}



.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
}



.info-card-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 5px 15px rgba(0, 212, 255, 0.3));
}

.info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.btn-info {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #00d4ff, #0096ff);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}



.btn-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

/* Municipality Detail Page */
.municipality-detail-hero {
    padding: 8rem 2rem 4rem;
    background: linear-gradient(135deg,
            var(--municipality-color, #00d4ff) 0%,
            rgba(123, 47, 247, 0.5) 100%);
    position: relative;
}

.municipality-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.municipality-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.municipality-detail-hero h1 {
    font-size: 4rem;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

.municipality-hero-description {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 800px;
    line-height: 1.8;
}

/* Municipality Stats */
.municipality-stats {
    padding: 0 2rem;
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}



.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Municipality Contact */
.municipality-contact {
    padding: 4rem 2rem;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-container h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 1.5rem;
}

.contact-icon {
    font-size: 2rem;
}

.contact-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.contact-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Municipality Content Sections */
.municipality-content {
    padding: 4rem 2rem;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.content-container h2 {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.signalements-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.signalement-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.signalement-item:hover {
    transform: translateX(5px);
    border-color: #00d4ff;
}

.signalement-type {
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
    font-size: 1.1rem;
    height: fit-content;
}

.signalement-details h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.signalement-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.signalement-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.signalement-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sondages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.sondage-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.sondage-card:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
}

.sondage-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.sondage-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.sondage-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-vote {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-vote:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.read-more {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more:hover {
    transform: translateX(3px);
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }

    .municipalities-grid {
        grid-template-columns: 1fr;
    }

    .municipality-card {
        height: 400px;
    }

    .municipality-detail-hero h1 {
        font-size: 2.5rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .signalement-item {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   VOTE MUNICIPALITY BADGES
   ========================================== */

.municipality-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    /* Fallback */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.municipality-badge.all-djerba {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 47, 247, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
}





/* Map & Weather */
.map-container,
.weather-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.map-container:hover,
.weather-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
}

#map {
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    height: 400px;
}

/* UI Polish Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.municipality-detail-hero,
.municipality-stats,
.location-section,
.municipality-contact,
.municipality-content {
    animation: fadeInUp 0.8s ease backwards;
}

.municipality-stats {
    animation-delay: 0.2s;
}

.location-section {
    animation-delay: 0.4s;
}

.municipality-contact {
    animation-delay: 0.6s;
}

.municipality-content {
    animation-delay: 0.8s;
}

/* Enhanced Button Hover */
.btn,
.btn-discover,
.read-more,
.btn-vote {
    position: relative;
    overflow: hidden;
}

.btn::after,
.btn-discover::after,
.read-more::after,
.btn-vote::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after,
.btn-discover:hover::after,
.read-more:hover::after,
.btn-vote:hover::after {
    width: 300px;
    height: 300px;
}
/* Quick Wins: Homepage Stats Band */
.stats-band {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.4) 0%, rgba(123, 47, 247, 0.1) 50%, rgba(15, 23, 42, 0.4) 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 3rem 0;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.stats-band-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}
.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-divider {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent);
}
@media (max-width: 768px) {
    .stats-band-inner { flex-direction: column; }
    .stat-divider { width: 60px; height: 1px; background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent); }
}

/* Quick Wins: Enhanced Footer */
.app-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 2rem 2rem 2rem;
    position: relative;
    z-index: 10;
}
[data-theme="light"] .app-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.app-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 4rem;
}
.footer-col {
    text-align: left;
}
.footer-col.brand-col .logo {
    display: flex;
    margin-bottom: 1rem;
}
.footer-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 300px;
}
.social-links {
    display: flex;
    gap: 1rem;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s;
}
.social-btn:hover {
    background: rgba(0,212,255,0.15);
    transform: translateY(-3px);
}
.footer-heading {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}
.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #00d4ff;
}
.footer-contact li {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
[data-theme="light"] .footer-bottom {
    border-top-color: rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
    .app-footer .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Quick Wins: Homepage News Cards Images & Placeholders */
.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.news-card-link .news-image {
    padding: 0;
    overflow: hidden;
    height: 200px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.news-card-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.news-card-link:hover img {
    transform: scale(1.05);
}
.news-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}
.news-img-1 { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.news-img-2 { background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%); }
.news-img-3 { background: linear-gradient(135deg, #0cebeb 0%, #20e3b2 50%, #29ffc6 100%); }
.news-img-4 { background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%); }
.news-content .news-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.news-cat {
    background: rgba(0,212,255,0.1);
    color: #00d4ff;
    padding: 2px 8px;
    border-radius: 12px;
}
.news-read-more {
    display: inline-block;
    margin-top: 1rem;
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
}
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
}
.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* Magazine Real Images */
.hero-bg-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}
.news-hero-image .hero-emoji { z-index: 2; position: relative; }
.news-hero-image .hero-overlay { z-index: 3; }
.card-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}
.magazine-card-image { position: relative; }
.card-emoji-wrapper { position: relative; z-index: 2; width:100%; height:100%; display:flex; align-items:center; justify-content:center;}
/* End Quick Wins */

/* Report Detail Page */
.signalement-detail-page {
    padding-bottom: 4rem;
}
.btn-back {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, transform 0.2s;
}
.btn-back:hover {
    color: #00d4ff;
    transform: translateX(-5px);
}
.detail-card {
    padding: 3rem;
}
.detail-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 2rem;
}
.detail-title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    margin-bottom: 1rem;
}
.detail-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.meta-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}
.description-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #00d4ff;
}
[data-theme="light"] .description-text { background: rgba(255,255,255,0.5); }
.detail-section h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0; left: 19px;
    height: 100%; width: 2px;
    background: rgba(255,255,255,0.1);
}
.timeline-step {
    position: relative;
    margin-bottom: 2.5rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.timeline-step.active {
    opacity: 1;
}
.step-icon {
    position: absolute;
    left: -40px; top: 0;
    width: 40px; height: 40px;
    background: var(--bg-secondary);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 1.2rem;
    z-index: 2;
}
.timeline-step.active .step-icon {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0,212,255,0.3);
}
.step-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}
.step-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}
@media(max-width: 768px) {
    .detail-card { padding: 1.5rem; }
}

/* Filters for Report List */
.filters-bar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}
.search-input-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: var(--text-primary);
    font-family: inherit;
}
.search-input-wrapper input:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0,0,0,0.4);
}
.search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
}
.filter-tab {
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.filter-tab:hover {
    background: rgba(255,255,255,0.1);
}
.filter-tab.active {
    background: rgba(0,212,255,0.15);
    color: #00d4ff;
    border-color: rgba(0,212,255,0.3);
}

/* Link to detail page */
.report-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.report-card-link:hover {
    transform: translateY(-8px);
}

/* Modern Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.custom-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    transform: translateX(120%);
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
[data-theme="light"] .custom-toast {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.custom-toast.toast-hiding {
    animation: slideOutToast 0.3s ease-in forwards;
}
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-icon { font-size: 1.2rem; }
.toast-body { flex: 1; font-weight: 500; font-size: 0.95rem; }
.toast-close {
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 1.5rem; cursor: pointer;
    padding: 0; line-height: 1; margin-left: auto;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes slideInToast {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}
@keyframes slideOutToast {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* ============================================================
   HAMBURGER MENU — Mobile Navigation
   ============================================================ */

/* Hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    z-index: 1001;
}

.nav-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* ── Mobile breakpoint ──────────────────────────────────── */
@media (max-width: 768px) {

    /* Show hamburger */
    .nav-hamburger {
        display: flex;
    }

    /* Nav container: logo + hamburger only on one row */
    .nav-container {
        flex-wrap: wrap;
        padding: 0 1rem;
        gap: 0;
        justify-content: space-between;
    }

    /* Logo stays left */
    .logo {
        flex: 1;
    }

    /* Links: hidden by default, dropdown on open */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0 1rem;
        order: 3;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* nav-right: language + user — hidden by default, shown in open menu */
    .nav-right {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.75rem;
        padding: 0.75rem 1rem 1rem;
        order: 4;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .nav-right.open {
        display: flex;
    }

    .nav-divider {
        display: none;
    }

    .nav-user-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    /* Page title smaller on mobile */
    .page-title {
        font-size: 2rem;
    }

    /* Signalement grid 1 column */
    .signalement-grid {
        grid-template-columns: 1fr;
    }
}

/* Poll results and eligibility states */
.poll-result-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.5rem 0 0.25rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.poll-restriction {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0 0.75rem;
}
.poll-voted {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
}
.poll-option input[type="radio"]:disabled + label {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Poll cards, detail page and citizen proposals */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.poll-card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.2s ease, border-color 0.2s ease; }
.poll-card-link:hover, .poll-card-link:focus-visible { transform: translateY(-2px); border-color: #00d4ff; }
.poll-card-link:focus-visible { outline: 2px solid #00d4ff; outline-offset: 3px; }
.poll-card-image { width: 100%; height: 150px; object-fit: cover; border-radius: 14px; margin-bottom: 1rem; }
.poll-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.poll-type { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); padding: 0.2rem 0.6rem; border: 1px solid var(--card-border); border-radius: 20px; }
.poll-to-vote { color: #f59e0b; font-weight: 700; font-size: 0.85rem; }
.poll-back { display: inline-block; margin-bottom: 1rem; color: var(--text-secondary); text-decoration: none; }
.poll-back:hover { color: var(--text-primary); }
.poll-detail { max-width: 760px; margin: 0 auto; }
.poll-detail-image { width: 100%; max-height: 320px; object-fit: cover; border-radius: 16px; margin-bottom: 1.2rem; }
.poll-detail-title { color: var(--text-primary); font-size: 1.6rem; line-height: 1.25; margin-bottom: 1rem; text-wrap: balance; }
.poll-facts { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: 0.35rem; color: var(--text-secondary); font-size: 0.9rem; }
.poll-detail-description { color: var(--text-primary); line-height: 1.6; margin-bottom: 1.5rem; max-width: 65ch; }
.option-description { display: block; color: var(--text-secondary); font-size: 0.8rem; font-weight: 400; margin-top: 0.2rem; }
.poll-option-budget { display: flex; align-items: center; gap: 0.75rem; }
.poll-option-budget label { flex: 1; margin-bottom: 0; cursor: default; }
.points-input { width: 5.5rem; padding: 0.6rem; border-radius: 10px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-primary); font-size: 1rem; text-align: right; font-variant-numeric: tabular-nums; }
.budget-remaining { color: var(--text-secondary); margin: 0.5rem 0 1rem; font-variant-numeric: tabular-nums; }
.poll-comment-label { display: block; color: var(--text-primary); font-weight: 600; margin: 0.75rem 0 0.4rem; }
.poll-comment-label small { font-weight: 400; color: var(--text-secondary); }
.poll-comment { width: 100%; box-sizing: border-box; padding: 0.7rem; border-radius: 10px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-primary); font: inherit; margin-bottom: 0.75rem; }
.poll-notice { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--card-border); color: var(--text-secondary); margin: 1rem 0; }
.poll-notice.success { color: #10b981; border-color: rgba(16, 185, 129, 0.4); }
.poll-results { margin-top: 1.5rem; }
.poll-share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.5rem; color: var(--text-secondary); }
.proposal-form { margin-bottom: 1.5rem; }
.proposal-form summary { cursor: pointer; font-weight: 700; color: var(--text-primary); }
.proposal-form label { display: block; color: var(--text-primary); font-weight: 600; margin: 0.75rem 0 0.3rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .poll-card-link, .option-fill { transition: none; } }
