/* =========================
   IMPORTS & VARIABLES
========================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --orange-primary: #f97316;
    --orange-dark: #ea580c;
    --gray-dark: #111827;
    --gray-medium: #1f2937;
    --gray-light: #374151;
}

/* =========================
   STYLE GLOBAL
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

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

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

@keyframes pulseSlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-slide-down {
    animation: slideDown 1s ease-out;
}

.animate-pulse-slow {
    animation: pulseSlow 3s ease-in-out infinite;
}

/* =========================
   SCROLLBAR PERSONNALISÉE
========================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--orange-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-dark);
}

/* =========================
   HEADER EFFECTS
========================= */
header {
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.2);
}

/* =========================
   BOUTONS
========================= */
.btn-primary {
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-dark));
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.4);
}

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

/* =========================
   CARDS VÉHICULES
========================= */
.vehicle-card {
    position: relative;
    overflow: hidden;
}

.vehicle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.1), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.vehicle-card:hover::before {
    left: 100%;
}

/* =========================
   EFFET GLASSMORPHISM
========================= */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================
   GRADIENT TEXT
========================= */
.gradient-text {
    background: linear-gradient(135deg, var(--orange-primary), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================
   HOVER EFFECTS
========================= */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* =========================
   LOADING ANIMATION
========================= */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--orange-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================
   RESPONSIVE UTILITIES
========================= */
@media (max-width: 768px) {
    .text-responsive {
        font-size: 1.5rem;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* =========================
   SECTION BACKGROUNDS
========================= */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
}

/* =========================
   FORM INPUTS
========================= */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--orange-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* =========================
   BADGE STYLES
========================= */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(249, 115, 22, 0.2);
    color: var(--orange-primary);
}

/* =========================
   TOOLTIP
========================= */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* =========================
   DIVIDER
========================= */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--orange-primary), transparent);
    margin: 2rem 0;
}

/* =========================
   PULSE EFFECT
========================= */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--orange-primary);
    opacity: 0.5;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* =========================
   SHINE EFFECT
========================= */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* =========================
   PRINT STYLES
========================= */
@media print {
    header,
    footer,
    .no-print {
        display: none;
    }
}


/* Scrollbar personnalisée */
.scrollbar-thin::-webkit-scrollbar {
    width: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Pour Firefox */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #e5e7eb;
}


/* Scrollbar pour le modal */
#searchReservationModal > div::-webkit-scrollbar {
    width: 10px;
}

#searchReservationModal > div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#searchReservationModal > div::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

#searchReservationModal > div::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* =========================
   FORMULAIRE HERO AMÉLIORÉ
========================= */

/* Animation pour les inputs au focus */
input:focus,
select:focus {
    transform: translateY(-2px);
}

/* Animation pour les boutons radio */
input[type="radio"]:checked + div {
    animation: radioCheck 0.3s ease-out;
}

@keyframes radioCheck {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Effet de survol sur les labels radio */
label:has(input[type="radio"]):hover {
    transform: translateY(-2px);
}

/* Animation du bouton de recherche */
button[type="submit"]:hover {
    animation: buttonPulse 1s infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 10px 60px rgba(249, 115, 22, 0.6);
    }
}

/* Animation des icônes dans les labels */
label i {
    transition: transform 0.3s ease;
}

label:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Effet de brillance sur le formulaire */
.animate-slide-down {
    animation: slideDown 0.8s ease-out, shine 3s infinite;
}

/* Amélioration du checkbox */
input[type="checkbox"]:checked {
    animation: checkboxBounce 0.3s ease-out;
}

@keyframes checkboxBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Effet de focus amélioré */
input:focus,
select:focus {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animation des mains pointant */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* =========================
   RESPONSIVE COMPLET
========================= */

/* Téléphone (< 640px) */
@media (max-width: 639px) {
    /* Cards véhicules */
    .vehicle-card .text-2xl,
    .vehicle-sale-card .text-2xl {
        font-size: 1.1rem !important;
    }
    .vehicle-card p,
    .vehicle-sale-card p {
        font-size: 0.85rem;
    }
    .vehicle-card .p-6,
    .vehicle-sale-card .p-6 {
        padding: 1rem !important;
    }
    .vehicle-card img,
    .vehicle-sale-card img {
        height: 180px !important;
    }

    /* Hero section */
    #accueil h1 {
        font-size: 2rem !important;
    }
    #accueil .text-xl {
        font-size: 1rem !important;
    }

    /* Formulaire hero */
    #searchForm .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Filtres catégories */
    .filter-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.7rem !important;
    }

    /* Section services */
    .services-grid {
        grid-template-columns: 1fr !important;
    }

    /* Témoignages */
    .temoignage-card {
        padding: 1rem !important;
    }

    /* Footer */
    footer .grid {
        grid-template-columns: 1fr !important;
    }

    /* Boutons d'action */
    .space-y-2 button {
        font-size: 0.8rem !important;
        padding: 0.6rem !important;
    }

    /* Prix */
    .text-xl.font-bold.text-orange-500 {
        font-size: 1rem !important;
    }

    /* Features badges */
    .vehicle-card .flex-wrap.gap-2 span,
    .vehicle-sale-card .flex-wrap.gap-2 span {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

/* Tablette (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
    .vehicle-card img,
    .vehicle-sale-card img {
        height: 200px !important;
    }
    .vehicle-card .text-2xl,
    .vehicle-sale-card .text-2xl {
        font-size: 1.2rem !important;
    }
    #accueil h1 {
        font-size: 3.5rem !important;
    }
}

/* Fix overflow horizontal global */
body {
    overflow-x: hidden;
}

/* Fix images qui débordent */
img {
    max-width: 100%;
}

/* Fix tableaux responsive */
table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* Fix modals sur mobile */
@media (max-width: 639px) {
    .fixed.inset-0 > div {
        margin: 0.5rem !important;
        max-height: 95vh !important;
        overflow-y: auto !important;
    }
}

/* =========================
   FIXES RESPONSIVE MOBILE
========================= */

/* Footer - eviter le debordement */
@media (max-width: 639px) {
    footer .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    footer p, footer span, footer a {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    footer .grid {
        gap: 2rem !important;
    }
    /* Newsletter input full width */
    footer form {
        flex-direction: column !important;
    }
    footer form input {
        width: 100% !important;
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem;
    }
    footer form button {
        width: 100% !important;
        border-radius: 0.5rem !important;
    }
    /* Logo footer */
    footer img {
        max-height: 3rem;
    }
    /* Texte footer qui deborde */
    footer .text-gray-400 {
        font-size: 0.8rem;
    }
}

/* Header - hamburger toujours visible */
@media (max-width: 639px) {
    header .flex.items-center.gap-1\\.5 {
        gap: 0.4rem !important;
    }
    #cartBtn {
        padding: 0.4rem 0.6rem !important;
    }
    #menuToggle {
        padding: 0.4rem !important;
        font-size: 1.3rem !important;
    }
}
