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

:root {
    --primary-color: #b0b435;      /* ← CHANGÉ EN VERT */
    --secondary-color: #8f952c;    /* ← VERT PLUS FONCÉ */
    --accent-color: #e67e22;       /* ← ORANGE POUR LES ACCENTS */
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #2c3e50;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

.nav-brand h1 {
    color: #b0b435;
    margin: 0;
    font-size: 1.3rem;
}

.nav-brand a {
    /*color: #b0b435;*/
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #b0b435;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.nav-link:first-child {
    color: #b0b435;
}

.nav-link.logout {
    color: #ff4444;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .nav {
        padding: 0 15px;
        height: 55px;
    }
    
    .nav-brand h1 {
        font-size: 1.1rem;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1rem;
    }
    
    .nav-link {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

.nav-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block !important;
    }
    
    .nav-links {
        display: none !important;
        position: absolute;
        top: 55px;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        gap: 0 !important;
        padding: 1rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-link, .nav-links button {
        width: 100%;
        text-align: center;
        padding: 12px !important;
    }
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

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

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); /* ← DÉGRADÉ VERT */
    color: var(--white);
    padding: 8rem 2rem 4rem;
    text-align: center;
    margin-top: 60px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-btn {
    background: #b0b435;
    color: black;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #d35400;
}

/* Events Section */
.events {
    padding: 4rem 2rem;
}

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

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 350px));
    gap: 2rem;
    justify-content: center;
}

.event-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.event-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
}

.event-content {
    padding: 1.5rem;
}

.event-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.event-date {
    color: #6b7280;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.event-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .section-title {
        font-size: 2rem;
    }

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

@media (max-width: 480px) {
    .nav {
        padding: 1rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .events {
        padding: 2rem 1rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .search-btn {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
}


/* Version mobile */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .nav-toggle {
        display: block;
        cursor: pointer;
        font-size: 24px;
    }
}

@media (min-width: 769px) {
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex !important;
    }
}


/* Créer évenements */

/* Container principal responsive */
.admin-container {
    max-width: 1200px;
    margin: 80px auto 2rem;
    padding: 0 15px;
    width: 100%;
}

/* Carte formulaire responsive */
.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px; /* Empêche le zoom sur iOS */
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .btn-success {
        width: auto;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .form-card {
        padding: 2rem;
    }
}

.btn-success:hover {
    background: #218838;
}

/* Image événement responsive */
.event-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px 8px 0 0;
}

/* Options de prix */
.price-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 4px;
}

@media (min-width: 480px) {
    .price-option {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.price-option:nth-child(1) {
    background: #e8f5e8;
}

.price-option:nth-child(2) {
    background: #fff3cd;
}

/* Container tableau responsive - CORRECTION IMPORTANTE */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 0 -15px;
    padding: 0 15px;
}

/* Tableau responsive */
.events-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Réduit de 950px à 600px */
}

/* Version desktop du tableau */
@media (min-width: 1024px) {
    .events-table {
        min-width: 800px;
    }
}

.events-table th {
    background: #b0b435;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.events-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}

.events-table tr:hover {
    background: #f9f9f9;
}

/* Version mobile - Vue en carte (optionnel mais recommandé) */
@media (max-width: 768px) {
    /* Alternative 1: Tableau scrollable horizontal */
    .table-container {
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .events-table th,
    .events-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    
    .events-table {
        min-width: 550px;
    }
}

/* Alternative 2: Vue en carte pour très petit mobile (décommentez pour activer) */
/*
@media (max-width: 600px) {
    .events-table,
    .events-table thead,
    .events-table tbody,
    .events-table th,
    .events-table td,
    .events-table tr {
        display: block;
    }
    
    .events-table thead {
        display: none;
    }
    
    .events-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: white;
    }
    
    .events-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #eee;
        text-align: right;
    }
    
    .events-table td:before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        margin-right: 15px;
        flex: 1;
    }
    
    .events-table td:last-child {
        border-bottom: none;
    }
    
    .actions {
        justify-content: flex-end;
    }
}
*/

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin: 2px;
    white-space: nowrap;
}

.badge.standard {
    background: #e8f5e8;
    color: #2d5016;
}

.badge.vip {
    background: #fff3cd;
    color: #856404;
}

/* Actions buttons */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-edit, 
.btn-delete {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 44px; /* Taille minimum pour le tactile */
    min-height: 44px;
}

.btn-edit {
    background: #17a2b8;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

/* Ajustements tactiles pour mobile */
@media (max-width: 768px) {
    .btn-edit, 
    .btn-delete {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .badge {
        padding: 5px 10px;
        font-size: 12px;
    }
}

.no-data {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

/* Responsive général */
@media (max-width: 768px) {
    .admin-container {
        margin: 70px auto 1rem;
        padding: 0 10px;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .price-option {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .admin-container {
        margin: 60px auto 1rem;
    }
    
    .events-table th,
    .events-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    .events-table {
        min-width: 480px;
    }
}




/* Section billet centrée */
.section_billet {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 50px 10px 10px;
    margin: 0 auto;
    width: 450px;
}

.section_billet > div {
    border: 2px solid #b0b435;
    padding: 25px;
    max-width: 450px;
    width: 100%;
    margin: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.section_billet h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.section_billet p {
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.section_billet p strong {
    color: #555;
    font-weight: 600;
}

.section_billet img {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 20px auto 0;
    padding: 10px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .section_billet {
        min-height: auto !important;;
        padding: 50px 20px 10px !important;;
    }
    
    .section_billet > div {
        padding: 20px;
        max-width: 400px;
    }
    
    .section_billet h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .section_billet p {
        margin: 10px 0;
        padding: 6px 0;
        font-size: 0.9rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .section_billet img {
        width: 150px;
        margin: 15px auto 0;
    }
}

@media (max-width: 480px) {
    .section_billet {
        padding: 10px;
    }
    
    .section_billet > div {
        padding: 15px;
        max-width: 100%;
    }
    
    .section_billet h2 {
        font-size: 1.3rem;
    }
    
    .section_billet p {
        font-size: 0.85rem;
    }
    
    .section_billet img {
        width: 130px;
    }
}

/* Pour très grands écrans */
@media (min-width: 1200px) {
    .section_billet > div {
        max-width: 500px;
        padding: 30px;
    }
    
    .section_billet h2 {
        font-size: 2rem;
    }
    
    .section_billet img {
        width: 250px;
    }
}

.billet-error {
    text-align: center;
    border-color: #dc3545;
}