/* Thème actif: Mon Thème Personnalisé5 */
/* Couleurs: #00d5ff, #015d6f, #000000, #1e293b */
/* Icônes: #ffffff | Hero: video */

/* ================================================
   VARIABLES CSS DYNAMIQUES - THÈME ACTUEL
   ================================================ */

:root {
    --primary-color: #00d5ff;
    --secondary-color: #015d6f;
    --bg-primary: #000000;
    --bg-secondary: #1e293b;
    --icon-color: #ffffff;
    --hero-bg-image: none;
    --hero-bg-type: video;
    
    /* Variables dérivées */
    --primary-color-rgb: 0, 213, 255;
    --secondary-color-rgb: 1, 93, 111;
    --bg-primary-rgb: 0, 0, 0;
    --bg-secondary-rgb: 30, 41, 59;
    --icon-color-rgb: 255, 255, 255;
}

/* ================================================
   STYLES DYNAMIQUES BASÉS SUR LE THÈME
   ================================================ */

/* ================================================
   REMPLACEMENT COMPLET DES CLASSES TAILWIND
   ================================================ */

/* Logo et branding */
.theme-primary,
.text-yellow-500 {
    color: var(--primary-color) !important;
}

.theme-bg-primary,
.bg-black {
    background-color: var(--bg-primary) !important;
}

.theme-bg-secondary,
.bg-gray-900 {
    background-color: var(--bg-secondary) !important;
}

/* Toutes les variantes de yellow-500 */
.text-yellow-500,
span.text-yellow-500,
a.text-yellow-500,
h1 .text-yellow-500,
h2 .text-yellow-500,
h3 .text-yellow-500,
.mobile-nav-link.text-yellow-500,
.nav-link.text-yellow-500 {
    color: var(--primary-color) !important;
}

/* Bordures yellow-500 */
.border-yellow-500 {
    border-color: var(--primary-color) !important;
}

/* Backgrounds yellow-500 */
.bg-yellow-500 {
    background-color: var(--primary-color) !important;
}

/* Ring colors */
.ring-yellow-500 {
    --tw-ring-color: var(--primary-color) !important;
}

/* Hover states */
.hover\\:text-yellow-500:hover {
    color: var(--primary-color) !important;
}

.hover\\:bg-yellow-500:hover {
    background-color: var(--primary-color) !important;
}

.hover\\:border-yellow-500:hover {
    border-color: var(--primary-color) !important;
}

/* Boutons primaires */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--bg-primary) !important;
}

.btn-primary:hover {
    box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.3) !important;
}

/* Boutons secondaires */
.btn-secondary {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

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

/* Navigation */
.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    background-color: var(--primary-color) !important;
}

.mobile-nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(var(--primary-color-rgb), 0.1) !important;
}

/* Service Cards */
.service-card {
    background: linear-gradient(135deg, rgba(var(--bg-secondary-rgb), 0.8), rgba(var(--bg-secondary-rgb), 0.6)) !important;
    border-color: rgba(var(--primary-color-rgb), 0.2) !important;
}

.service-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 20px 40px rgba(var(--primary-color-rgb), 0.1) !important;
}

.service-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--bg-primary) !important;
}

/* Portfolio */
.portfolio-overlay {
    background: linear-gradient(transparent, rgba(var(--bg-primary-rgb), 0.8)) !important;
}

/* Forms */
.form-input {
    background-color: rgba(var(--bg-secondary-rgb), 0.8) !important;
    border-color: rgba(var(--primary-color-rgb), 0.3) !important;
}

.form-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1) !important;
}

/* Social Links */
.social-link {
    background-color: rgba(var(--primary-color-rgb), 0.1) !important;
    color: var(--primary-color) !important;
}

.social-link:hover {
    background-color: var(--primary-color) !important;
    color: var(--bg-primary) !important;
}

/* Admin Dashboard */
.nav-item:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1) !important;
}

.nav-item.active {
    background-color: var(--primary-color) !important;
    color: var(--bg-primary) !important;
}

/* Reservation Steps */
.step.active .step-number {
    background-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.3) !important;
}

.step.active .step-title {
    color: var(--primary-color) !important;
}

/* Payment Method Selection */
.payment-method-option.selected div {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1) 0%, var(--bg-secondary) 100%) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3) !important;
}

/* Service Selection */
.service-option.selected .service-card {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1) 0%, var(--bg-secondary) 100%) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3) !important;
}

/* Loading Spinner */
.animate-spin {
    border-color: var(--primary-color) var(--primary-color) var(--primary-color) transparent !important;
}

/* Success Messages */
.message-success {
    background-color: rgba(var(--primary-color-rgb), 0.1) !important;
    border-color: rgba(var(--primary-color-rgb), 0.3) !important;
    color: var(--primary-color) !important;
}

/* Scrollbar */
::-webkit-scrollbar-thumb {
    background: var(--primary-color) !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color) !important;
}

/* Gradients CTA Sections */
.bg-gradient-to-r.from-yellow-500.to-yellow-600,
.from-yellow-500,
.to-yellow-600 {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
}

/* Puces et petits éléments - SANS affecter les SVG */
.w-2.h-2.bg-green-500.rounded-full,
.w-3.h-3.bg-yellow-500.rounded-full {
    background-color: var(--primary-color) !important;
}

.bg-green-500:not(svg):not(path) {
    background-color: var(--primary-color) !important;
}

/* SVG et icônes - Utilisation de la couleur icône dédiée */
svg.text-yellow-500,
.text-yellow-500 svg,
svg[class*="text-yellow-500"],
.service-icon svg,
.nav-icon svg,
.icon svg {
    color: var(--icon-color) !important;
    fill: var(--icon-color) !important;
}

/* SOLUTION SIMPLE - Forcer TOUTES les icônes à utiliser la couleur du thème */
/* Sauf les exceptions explicites */
svg:not(.keep-original-color):not(.animate-spin) {
    color: var(--icon-color) !important;
    fill: var(--icon-color) !important;
}

/* Exceptions pour les icônes qui doivent garder leur couleur */
svg.animate-spin,
.animate-spin svg,
svg.text-white:not(.theme-icon),
svg.text-red-500:not(.theme-icon),
svg.text-green-500:not(.theme-icon) {
    /* Ces icônes gardent leur couleur originale */
}

/* Path dans les SVG */
svg .text-yellow-500,
svg path {
    fill: currentColor !important;
}

/* Icônes de service spécifiques */
.service-icon {
    background: linear-gradient(135deg, var(--icon-color), var(--secondary-color)) !important;
    color: var(--bg-primary) !important;
}

/* Icônes dans les boutons et navigation */
.btn-primary svg,
.nav-link svg,
.mobile-nav-link svg {
    fill: currentColor !important;
}

/* Corrections spécifiques pour les éléments inline */
span[style*="#FFD700"],
div[style*="#FFD700"],
*[style*="color: #FFD700"],
*[style*="background-color: #FFD700"] {
    color: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
}

/* Footer border */
.border-yellow-500 {
    border-color: var(--primary-color) !important;
}

/* Responsive classes */
@media (max-width: 768px) {
    .sm\\:bg-yellow-500 {
        background-color: var(--primary-color) !important;
    }
    
    .sm\\:text-yellow-500 {
        color: var(--primary-color) !important;
    }
}

@media (min-width: 768px) {
    .md\\:bg-yellow-500 {
        background-color: var(--primary-color) !important;
    }
    
    .md\\:text-yellow-500 {
        color: var(--primary-color) !important;
    }
}

/* Classes focus */
.focus\\:border-yellow-500:focus {
    border-color: var(--primary-color) !important;
}

.focus\\:ring-yellow-500:focus {
    --tw-ring-color: var(--primary-color) !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .service-card {
        background: rgba(var(--bg-secondary-rgb), 0.9) !important;
    }
}

/* Animations avec couleurs dynamiques */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tailles spécifiques pour les icônes de service */
.service-icon svg {
    width: 2rem !important;
    height: 2rem !important;
}

/* Utilities */
.theme-text-primary { color: var(--primary-color) !important; }
.theme-text-secondary { color: var(--secondary-color) !important; }
.theme-text-icon { color: var(--icon-color) !important; }
.theme-border-primary { border-color: var(--primary-color) !important; }
.theme-border-secondary { border-color: var(--secondary-color) !important; }

/* ================================================
   STYLES CTA - BOUTONS CALL TO ACTION
   ================================================ */

/* Sections CTA - Background dégradé thématique */
.bg-gradient-to-r.from-yellow-500.to-yellow-600 {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
}

/* CTA Bouton 1 - Background primaire + texte icône */
.btn-secondary.bg-black.text-yellow-500,
a.btn-secondary.bg-black.text-yellow-500 {
    background-color: var(--bg-primary) !important;
    color: var(--icon-color) !important;
}

.btn-secondary.bg-black.text-yellow-500:hover,
a.btn-secondary.bg-black.text-yellow-500:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--icon-color) !important;
}

/* CTA Bouton 2 - Background transparent + bordure + texte icône */
.btn-secondary.bg-transparent.border-black.text-black,
a.btn-secondary.bg-transparent.border-black.text-black {
    background-color: transparent !important;
    border-color: var(--icon-color) !important;
    color: var(--icon-color) !important;
}

.btn-secondary.bg-transparent.border-black.text-black:hover,
a.btn-secondary.bg-transparent.border-black.text-black:hover {
    background-color: var(--icon-color) !important;
    border-color: var(--icon-color) !important;
    color: var(--bg-primary) !important;
}

/* Textes dans les sections CTA */
.bg-gradient-to-r .text-black {
    color: var(--bg-primary) !important;
}

/* Icônes rondes dans CTA Contact */
.bg-yellow-500.rounded-full {
    background-color: var(--primary-color) !important;
}

.bg-yellow-500.rounded-full svg {
    color: var(--icon-color) !important;
}

/* ================================================
   BADGES ET ICÔNES DYNAMIQUES - SITE PUBLIC
   ================================================ */

/* Tous les badges ronds jaunes */
.w-8.h-8.bg-yellow-500.rounded-full,
.w-12.h-12.bg-yellow-500.rounded-full,
.w-16.h-16.bg-yellow-500.rounded-full,
.w-24.h-24.bg-yellow-500.rounded-full {
    background-color: var(--primary-color) !important;
}

/* Icônes dans les badges ronds jaunes */
.w-8.h-8.bg-yellow-500.rounded-full svg,
.w-12.h-12.bg-yellow-500.rounded-full svg,
.w-16.h-16.bg-yellow-500.rounded-full svg,
.w-24.h-24.bg-yellow-500.rounded-full svg {
    color: var(--icon-color) !important;
}

/* Badges carrés/arrondis jaunes */
.w-12.h-12.bg-yellow-500.rounded-lg,
.w-16.h-16.bg-yellow-500.rounded-lg {
    background-color: var(--primary-color) !important;
}

.w-12.h-12.bg-yellow-500.rounded-lg svg,
.w-16.h-16.bg-yellow-500.rounded-lg svg {
    color: var(--icon-color) !important;
}

/* Badges avec dégradé (équipe) */
.bg-gradient-to-br.from-yellow-500.to-yellow-600 {
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color)) !important;
}

/* Badges certifications (texte initiales) */
.w-16.h-16.bg-yellow-500.rounded-full,
.w-24.h-24.bg-gradient-to-br.from-yellow-500.to-yellow-600.rounded-full {
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color)) !important;
    color: var(--bg-primary) !important;
}

/* Badges spéciaux avec couleurs fixes (exceptions contrôlées) */
.bg-green-500.rounded-full {
    background-color: #10B981 !important; /* Garder vert pour "Écologique" */
}

.bg-blue-500.rounded-full {
    background-color: #3B82F6 !important; /* Garder bleu pour "Innovation" */
}

/* Mais leurs icônes utilisent quand même la couleur thème */
.bg-green-500.rounded-full svg,
.bg-blue-500.rounded-full svg {
    color: white !important; /* Contraste optimal */
}

/* Compteurs dans admin (badges numériques) */
.bg-yellow-500.text-black.rounded-full,
.bg-blue-500.text-white.rounded-full {
    background-color: var(--primary-color) !important;
    color: var(--bg-primary) !important;
}

/* ================================================
   BLOCS SPÉCIAUX PAGE CONTACT
   ================================================ */

/* Blocs "Intervention d'urgence" et "Bon à savoir" */
.bg-yellow-500.bg-opacity-10.border.border-yellow-500 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    border-color: var(--primary-color) !important;
    border-width: 2px !important;
}

/* Titres des blocs spéciaux */
.bg-yellow-500.bg-opacity-10 .text-yellow-500 {
    color: var(--bg-primary) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Texte dans les blocs spéciaux */
.bg-yellow-500.bg-opacity-10 .text-gray-300,
.bg-yellow-500.bg-opacity-10 p {
    color: var(--bg-primary) !important;
}

/* Lien téléphone dans le bloc urgence */
.bg-yellow-500.bg-opacity-10 a.text-yellow-500 {
    color: var(--bg-primary) !important;
    font-weight: bold !important;
    text-decoration: underline !important;
}

.bg-yellow-500.bg-opacity-10 a.text-yellow-500:hover {
    color: rgba(var(--bg-primary-rgb), 0.8) !important;
}

/* ================================================
   HERO BACKGROUND PERSONNALISÉ
   ================================================ */

/* Section hero avec background dynamique */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Background image personnalisé quand activé */
.hero-section[data-bg-type="image"] {
    background-image: var(--hero-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Background image avec overlay */
.hero-section[data-bg-type="image"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg, 
        rgba(var(--bg-primary-rgb), 0.7) 0%, 
        rgba(var(--bg-primary-rgb), 0.5) 50%,
        rgba(var(--bg-primary-rgb), 0.8) 100%
    );
    z-index: 1;
}

/* Contenu du hero au-dessus de l'overlay */
.hero-section .hero-content {
    position: relative;
    z-index: 2;
}

/* Masquer la vidéo quand image est active */
.hero-section[data-bg-type="image"] .hero-video {
    display: none !important;
}

/* Video background styling */
.hero-section[data-bg-type="video"] .hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Portfolio Grid dynamique */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.portfolio-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(var(--primary-color-rgb), 0.1);
    transform: translateY(-5px);
}

.portfolio-item-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.portfolio-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-item-image img {
    transform: scale(1.05);
}

.portfolio-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(var(--bg-primary-rgb), 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.portfolio-item:hover .portfolio-item-overlay {
    opacity: 1;
}

.portfolio-item-content {
    padding: 1.5rem;
}

.portfolio-item-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.portfolio-item-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.5;
}

.portfolio-category-badge {
    display: inline-block;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .portfolio-item-image {
        height: 200px;
    }
    
    .hero-section[data-bg-type="image"] {
        background-attachment: scroll; /* Meilleure performance mobile */
    }
}