
:root {
    --bg-color: #f7f9f7;
    --card-bg: #ffffff;
    --primary: #2c4c3b;
    --primary-hover: #1e3327;
    --secondary: #2b2d42;
    --accent: #d4a373;
    --accent-light: #e8ede9;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #e2e7e3;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(44, 76, 59, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 3rem;
}

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #17271f 100%);
    color: white;
    padding: 3.5rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2.5rem;
    border-bottom: 4px solid var(--accent);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.hero-content p {
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* CONTAINER & CARTES */
.container {
    max-width: 1253px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 2.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 0.8rem;
}

h2 {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 600;
}

.badge {
    background: var(--accent-light);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* FORMULAIRES */
form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.datetime-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.datetime-split input {
    width: 100%;
    min-width: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

input[type="text"],
input[type="date"],
input[type="time"] {
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    width: 100%;
    min-width: 0;
    height: 52px;
    background: #fafbfa;
    color: var(--text-main);
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(44, 76, 59, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(44, 76, 59, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* TABLEAU COVOITURAGE */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    white-space: nowrap;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f2f5f3;
    color: var(--primary);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

.join-btn {
    background: var(--accent);
    color: var(--text-main);
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.join-btn:hover {
    opacity: 0.9;
}

/* BURGER */
.ingredients-section {
    margin-top: 0.5rem;
}

.ingredients-section h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    background: #f2f5f3;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary);
}

.chip:has(input:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chip input {
    display: none;
}

.burger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.burger-item {
    background: #fafbfa;
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 5px solid var(--primary);
    border: 1px solid var(--border-color);
    border-left-width: 5px;
}

.burger-item strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--primary);
}

.burger-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* GALERIE */
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1.2rem;
    padding: 0.8rem 1rem;
    z-index: 10;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.prev { left: 15px; }
.next { right: 15px; }

/* UPLOAD */
.upload-form-bottom {
    background: #f2f5f3;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

input[type="file"] {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content select,
.modal-content input {
    padding: 10px;
    width: 100%;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.btn-green {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.btn-green:hover {
    background: #1b5e20;
}

.btn-small {
    background: #eee;
    border: 1px solid #ccc;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.delete-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* COLONNES COVOITURAGE / BURGER + ON AMÈNE */
.top-grid-layout {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 25px;
    align-items: stretch;
    margin: 0 0 20px;
}

/* Les deux cartes de gauche sont empilées et de largeur identique. */
.left-content-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.left-content-column > .card {
    width: 100%;
    min-width: 0;
}

/* PANNEAU ON AMÈNE */
.bring-card-sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    min-width: 0;
    background: #ffffff;
    border: 2px solid #2e7d32;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.1);
}

.bring-card-sidebar h3 {
    margin-top: 0;
    color: #2e7d32;
    font-size: 1.1rem;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bring-list {
    max-height: none;
    overflow: visible;
    margin-bottom: 15px;
    padding-right: 5px;
}

.bring-item {
    background: #f1f8e9;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #2e7d32;
}

.bring-item small {
    display: block;
    color: #558b2f;
    font-size: 0.75rem;
}

.bring-form-inline {
    display: flex;
    gap: 8px;
}

.bring-form-inline input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 0.9rem;
}

.bring-form-inline input:focus {
    outline: none;
    border-color: #2e7d32;
}

.btn-plus {
    background: #2e7d32;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-plus:hover {
    background: #1b5e20;
}

.delete-bring-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0 5px;
}

.delete-bring-btn:hover {
    color: #b71c1c;
}

/* TABLETTE ET MOBILE */
@media (max-width: 900px) {
    .top-grid-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .bring-card-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

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

    .hero-content h1 {
        font-size: 2.3rem;
    }

    .card {
        padding: 1.3rem;
    }
}
