/* ==========================================
   COLOR VARIABLES & COMMON STYLES
   ========================================== */
:root {
    --color-primary: #738D60;      /* Vert miel */
    --color-secondary: #DEBC31;    /* Doré */
    --color-accent: #9D471A;       /* Brun */
    --color-light: #C8DAAD;        /* Vert pâle */
    --color-muted: #989E53;        /* Olive */
    --bg-light: #faf8f6;
    --bg-white: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --border-color: #e8eef5;
}

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

html, body {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ==========================================
   HOME PAGE STYLES
   ========================================== */
.home-body {
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.navbar {
    background: var(--bg-white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-secondary);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

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

.navbar-action {
    display: flex;
    gap: 1rem;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-tagline {
    font-size: 0.95rem;
    color: var(--color-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
}

.feature-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--color-secondary);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-benefits {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}

.feature-benefits li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-benefits li::before {
    content: '✓';
    color: var(--color-secondary);
    font-weight: bold;
    font-size: 1rem;
}

.feature-cta {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-muted));
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.feature-card:hover .feature-cta {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(115, 141, 96, 0.3);
}

/* Feature Card Colors */
.feature-card.import-card { --accent: #9D471A; }
.feature-card.plan-card { --accent: #DEBC31; }
.feature-card.visualize-card { --accent: #738D60; }

.feature-card.import-card .feature-title { color: #9D471A; }
.feature-card.plan-card .feature-title { color: #DEBC31; }
.feature-card.visualize-card .feature-title { color: #738D60; }

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: rgba(255, 255, 255, 0.5);
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--color-primary);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-secondary);
}

/* ==========================================
   INDEX PAGE STYLES
   ========================================== */
.app-container { display: flex; height: 100vh; }

/* Navbar */
.navbar-app {
    background: linear-gradient(180deg, #fefdfb 0%, #faf8f6 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 3px solid #DEBC31;
    position: relative;
}

.navbar-app::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #DEBC31 0%, #9D471A 50%, #DEBC31 100%);
}

.navbar-logo {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    transition: all 0.2s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-app h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #9D471A 0%, #738D60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.8px;
    font-style: italic;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #ffffff 0%, #faf8f6 100%);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.sidebar-section {
    padding: 20px 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(90deg, #738D60, #DEBC31);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 0.8px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
    border: 2px solid transparent;
    background: transparent;
}

.task-item:hover {
    background: rgba(115, 141, 96, 0.08);
    color: var(--color-primary);
    border-color: rgba(115, 141, 96, 0.2);
    transform: translateX(2px);
}

.task-item.active {
    background: linear-gradient(135deg, rgba(222, 188, 49, 0.15), rgba(157, 71, 26, 0.08));
    color: var(--color-accent);
    border-color: var(--color-secondary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(222, 188, 49, 0.1);
}

.task-icon {
    margin-right: 12px;
    font-size: 20px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.view-section {
    display: none;
}

.view-section.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Map view */
.map-container {
    display: flex;
    gap: 15px;
    height: 100%;
}

#map {
    flex: 1;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(115, 141, 96, 0.1);
    border: 2px solid var(--border-color);
}

.sidebar-right {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.card {
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(115, 141, 96, 0.08);
    padding: 16px;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(115, 141, 96, 0.12);
    border-color: var(--color-primary);
}

.card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3::before {
    content: '🐝';
    font-size: 16px;
}

/* Plan study view */
.plan-study-container {
    display: flex;
    gap: 15px;
}

.plan-map {
    flex: 1;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(115, 141, 96, 0.1);
    border: 2px solid var(--border-color);
}

.plan-panel {
    width: 280px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(115, 141, 96, 0.1);
    border: 2px solid var(--color-light);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.plan-panel h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(115, 141, 96, 0.1);
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #738D60, #89a06e);
    color: white;
    box-shadow: 0 2px 8px rgba(115, 141, 96, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #637a52, #738D60);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(115, 141, 96, 0.3);
}

.btn-secondary {
    background: var(--color-light);
    color: var(--color-primary);
    font-weight: 600;
}

.btn-secondary:hover {
    background: #b5d099;
    transform: translateY(-1px);
}

/* Import data view */
.import-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-zone {
    background: linear-gradient(135deg, #faf8f6 0%, #f5f3f0 100%);
    border: 3px dashed var(--color-light);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #f0eeea 0%, #ebe5df 100%);
}

.upload-zone.active {
    border-color: var(--color-secondary);
    background: linear-gradient(135deg, #fffbf0 0%, #fff7e6 100%);
    box-shadow: 0 4px 12px rgba(222, 188, 49, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-text strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* ==========================================
   MAP PAGE STYLES
   ========================================== */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    flex-direction: column;
}

.navbar-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.navbar-btn:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-color: transparent;
}

/* Main Content */
.map-container-full {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.sidebar-full {
    width: 280px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-full.collapsed {
    transform: translateX(-100%);
    width: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(115, 141, 96, 0.05), rgba(222, 188, 49, 0.05));
}

.sidebar-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.sidebar-item {
    padding: 10px;
    margin: 4px 0;
    background: var(--bg-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: linear-gradient(135deg, rgba(115, 141, 96, 0.1), rgba(222, 188, 49, 0.1));
    border-left-color: var(--color-secondary);
}

.sidebar-item-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Data Panel (Right) */
.data-panel {
    width: 320px;
    background: var(--bg-white);
    border-left: 1px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 10;
    overflow-y: auto;
}

.data-panel.hidden {
    transform: translateX(100%);
    width: 0;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(115, 141, 96, 0.05), rgba(222, 188, 49, 0.05));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-weight: 700;
    color: var(--color-primary);
}

.panel-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.panel-close:hover {
    color: var(--color-accent);
}

.panel-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* Charts */
.chart-section {
    margin-bottom: 24px;
}

.chart-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
}

.chart-container {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 12px;
    min-height: 200px;
    border: 1px solid var(--border-color);
}

/* Controls */
.map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.control-btn:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

/* ==========================================
   LEAFLET OVERRIDES
   ========================================== */
.leaflet-control-layers {
    background: var(--bg-white) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(115, 141, 96, 0.1) !important;
    padding: 12px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    border: 2px solid var(--border-color) !important;
}

.leaflet-control-layers h3 {
    margin: 0 0 10px 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
}

.leaflet-control-layers .form-check {
    margin-bottom: 8px !important;
}

.leaflet-control-layers .form-check-input {
    margin-top: 2px !important;
    accent-color: var(--color-primary) !important;
}

.leaflet-control-layers-toggle {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23738D60"><path d="M3 3h18v2H3V3zm0 8h18v2H3v-2zm0 8h18v2H3v-2z"/></svg>');
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-tip {
    background: var(--bg-white);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-title {
        font-size: 1.25rem;
    }

    .sidebar-full {
        width: 100%;
        position: absolute;
        left: 0;
        top: 50px;
        height: calc(100% - 50px);
        z-index: 20;
    }

    .data-panel {
        width: 100%;
        position: absolute;
        right: 0;
        top: 50px;
        height: calc(100% - 50px);
        z-index: 20;
    }

    .navbar {
        padding: 10px 16px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-item {
    animation: slideIn 0.3s ease;
}
