/* 
 * responsive-mobile.css - CSS responsive pour mobile
 * À inclure sur toutes les pages après Tailwind et les autres CSS
 */

/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --color-primary: #b45309;
    --color-secondary: #f59e0b;
    --color-text: #1f2937;
    --spacing-mobile: 1rem;
}

/* ============================================
   BASE MOBILE-FIRST
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   HEADER RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Header principal */
    header .relative.w-full {
        height: 120px !important; /* Encore plus petit */
    }
    
    header .h-64 {
        height: 120px !important;
    }
    
    /* Logo et titre */
    header .flex.items-center {
        padding: 0.5rem 0 !important;
    }
    
    header .flex.items-center img {
        height: 1.75rem !important; /* Logo plus petit */
        margin-right: 0.5rem !important;
    }
    
    header h1 {
        font-size: 0.9rem !important;
    }
    
    /* Barre de navigation compacte */
    header .absolute.bottom-0 {
        position: relative !important;
        padding: 0 !important;
        background-color: #b45309 !important;
    }
    
    /* Menu navigation horizontal compact */
    nav ul {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0 !important;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    nav ul li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-right: 1px solid rgba(255,255,255,0.1);
    }
    
    nav ul li:nth-child(3n) {
        border-right: none;
    }
    
    nav ul li a {
        display: block;
        padding: 0.65rem 0.5rem;
        text-align: center;
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    nav ul li a:hover,
    nav ul li a.underline {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Menus déroulants compacts */
    .dropdown-menu {
        width: 100%;
        position: relative;
    }
    
    .dropdown-content {
        position: absolute !important;
        display: none;
        width: 100%;
        left: 0;
        top: 100%;
        margin-top: 0 !important;
        padding-top: 0 !important;
        background-color: #92400e !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
        z-index: 1000;
    }
    
    .dropdown-content a {
        padding: 0.75rem 1rem !important;
        font-size: 0.75rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .dropdown-menu:hover .dropdown-content {
        display: block;
    }
    
    /* Masquer le texte "▾" */
    nav a::after {
        content: none !important;
    }
}

/* ============================================
   CONTENEURS ET GRILLES
   ============================================ */
@media (max-width: 768px) {
    /* Containers */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .max-w-6xl,
    .max-w-4xl,
    .max-w-3xl {
        max-width: 100% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Grilles en 1 colonne sur mobile */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .md:grid-cols-2,
    .md:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    /* Colonnes Tailwind */
    [class*="sm:col-span-"],
    [class*="md:col-span-"],
    [class*="lg:col-span-"] {
        grid-column: span 12 !important;
    }
}

/* ============================================
   CALENDRIER RESPONSIVE - COMPACT
   ============================================ */
@media (max-width: 768px) {
    /* Titre page compact */
    .page-title h2 {
        font-size: 1.1rem !important;
    }
    
    /* Vignette plus petite */
    .hunt-vignette {
        width: 100% !important;
        height: auto !important;
        max-width: 150px !important;
        margin: 0 auto 0.75rem !important;
    }
    
    /* Section chasse compacte */
    .hunt-section {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Infos centrées */
    .hunt-info {
        text-align: center !important;
        margin-bottom: 0.75rem !important;
        font-size: 0.9rem;
    }
    
    .hunt-info p {
        margin: 0.25rem 0;
    }
    
    /* Dot plus petit */
    .dot {
        width: 20px !important;
        height: 20px !important;
        display: inline-block;
        vertical-align: middle;
        margin-right: 0.5rem;
    }
    
    /* Formulaires ultra-compacts */
    .hunt-form {
        font-size: 0.85rem;
    }
    
    .hunt-form .flex {
        gap: 0.5rem !important;
    }
    
    /* Groupes de champs compacts */
    .field-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .field-label {
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        color: #2563eb;
        margin-bottom: 0.25rem;
        padding: 0.15rem 0.4rem;
        background: #fef3c7;
        border-radius: 4px;
        border: 1px solid #f59e0b;
        display: inline-block;
    }
    
    .field {
        width: 100% !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
        min-width: auto !important;
        max-width: 100% !important;
    }
    
    /* Inline compact pour fusils/rabat */
    .inline-compact {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .inline-compact .field {
        width: 60px !important;
        flex-shrink: 0;
    }
    
    .inline-compact span {
        font-size: 0.85rem;
    }
    
    /* Boutons compacts */
    .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    .hunt-actions {
        margin-top: 0.75rem;
    }
    
    .hunt-actions .btn {
        width: 100%;
    }
    
    /* Message d'état */
    .status-message {
        font-size: 0.7rem !important;
        margin-top: 0.5rem !important;
    }
}

/* ============================================
   TABLEAUX RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Tables deviennent scrollables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }
    
    thead {
        display: none; /* Cache les en-têtes sur mobile */
    }
    
    tbody {
        display: block;
    }
    
    tr {
        display: block;
        margin-bottom: 0.5rem;
        border: 1px solid #e5e7eb;
        border-radius: 4px;
        padding: 0.5rem;
        background: white;
    }
    
    td {
        display: block;
        text-align: left !important;
        padding: 0.25rem 0 !important;
        border: none !important;
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    td:before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 80px;
        margin-right: 0.5rem;
        color: var(--color-primary);
        font-size: 0.7rem;
    }
    
    /* Liste des inscrits compacte */
    #bloc-liste-* tr {
        padding: 0.4rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    [id^="bloc-liste-"] tr {
        padding: 0.4rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    [id^="bloc-liste-"] td {
        padding: 0.2rem 0 !important;
        font-size: 0.75rem !important;
    }
    
    [id^="bloc-liste-"] td:before {
        width: 60px !important;
        font-size: 0.65rem !important;
    }
    
    /* Bouton fermer liste compact */
    [id^="bloc-liste-"] button,
    [id^="bloc-liste-"] .btn {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.7rem !important;
        margin-top: 0.3rem;
    }
    
    /* Nom de personne en gras */
    [id^="bloc-liste-"] td:first-child {
        font-weight: 600;
        font-size: 0.85rem !important;
        padding-bottom: 0.15rem !important;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 0.15rem;
    }
    
    /* Alternative: table scrollable horizontale */
    .table-scroll-mobile {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-scroll-mobile table {
        min-width: 500px;
        font-size: 0.75rem;
    }
}

/* ============================================
   FORMULAIRES RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    form {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important; /* Évite le zoom sur iOS */
        padding: 0.5rem 0.75rem !important;
    }
    
    label {
        display: block;
        margin-bottom: 0.4rem;
        font-weight: 600;
        font-size: 0.85rem;
    }
    
    .form-group,
    .space-y-4 > div {
        margin-bottom: 0.75rem;
    }
    
    button[type="submit"],
    input[type="submit"] {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   GALERIE PHOTOS RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .slideshow-container {
        height: 35vh !important;
        max-height: 350px !important;
    }
    
    .slideshow-image {
        object-fit: contain;
    }
    
    /* Galerie en grille */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .gallery-item {
        aspect-ratio: 1;
    }
}

/* ============================================
   CARTES ET SECTIONS
   ============================================ */
@media (max-width: 768px) {
    .bg-white,
    .rounded-lg,
    .shadow-lg,
    .shadow-md {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem;
    }
    
    h1 {
        font-size: 1.3rem !important;
    }
    
    h2 {
        font-size: 1.15rem !important;
    }
    
    h3 {
        font-size: 1rem !important;
    }
    
    .text-3xl {
        font-size: 1.3rem !important;
    }
    
    .text-2xl {
        font-size: 1.15rem !important;
    }
    
    .text-xl {
        font-size: 1rem !important;
    }
}

/* ============================================
   ESPACEMENTS MOBILE
   ============================================ */
@media (max-width: 768px) {
    .py-12,
    .py-10 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .px-6,
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .mt-10,
    .mt-12 {
        margin-top: 1.5rem !important;
    }
    
    .mb-6,
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    .gap-6 {
        gap: 0.75rem !important;
    }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    footer {
        padding: 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    footer p {
        margin: 0;
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */
@media (max-width: 768px) {
    /* Cache les éléments sur mobile */
    .hide-on-mobile {
        display: none !important;
    }
    
    /* Affiche uniquement sur mobile */
    .show-on-mobile {
        display: block !important;
    }
    
    /* Texte centré sur mobile */
    .mobile-center {
        text-align: center !important;
    }
    
    /* Largeur pleine sur mobile */
    .mobile-full-width {
        width: 100% !important;
    }
    
    /* Scroll horizontal pour débordements */
    .overflow-mobile-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   AMÉLIORATIONS TACTILES
   ============================================ */
@media (max-width: 768px) {
    /* Zones cliquables plus grandes */
    a, button, input[type="submit"], select {
        min-height: 44px;
    }
    
    /* Meilleur feedback tactile */
    button:active,
    a:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    /* Désactive le zoom sur double-tap */
    * {
        touch-action: manipulation;
    }
}

/* ============================================
   OPTIMISATIONS PERFORMANCE MOBILE
   ============================================ */
@media (max-width: 768px) {
    /* Réduit les ombres pour améliorer les performances */
    .shadow-lg {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Optimise les transitions */
    * {
        transition-duration: 0.15s !important;
    }
}

/* ============================================
   LANDSCAPE MODE (paysage) sur mobile
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    header .relative.w-full,
    header .h-64 {
        height: 100px !important;
    }
    
    .slideshow-container {
        height: 45vh !important;
    }
}

/* ============================================
   TRÈS PETITS ÉCRANS (<375px)
   ============================================ */
@media (max-width: 375px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    h1 {
        font-size: 1.15rem !important;
    }
    
    h2 {
        font-size: 1rem !important;
    }
    
    .field {
        font-size: 0.8rem !important;
        padding: 0.35rem 0.5rem !important;
    }
}