/* Styles personnalisés pour le site d'avocat */

/* Variables CSS pour la cohérence des couleurs */
:root {
    --color-primary: #475569;
    --color-secondary: #64748b;
    --color-accent: #3b82f6;
    --color-accent-dark: #1d4ed8;
    --color-background: #f8fafc;
    --color-background-secondary: #f1f5f9;
    --color-text-primary: #1e293b;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-white: #ffffff;
    --color-gray-light: #f1f5f9;
    --color-gray-medium: #cbd5e1;
    --color-gray-dark: #475569;
    
    /* Typographie */
    --font-family: 'Inter', sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordures */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--color-text-secondary);
    line-height: 1.6;
    background-color: var(--color-background);
}

/* Typographie cohérente */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-semibold);
}

h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
}

p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

/* Classes utilitaires pour les couleurs */
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-accent-dark { color: var(--color-accent-dark) !important; }
.text-white { color: var(--color-white) !important; }

.bg-primary { background-color: var(--color-background) !important; }
.bg-secondary { background-color: var(--color-background-secondary) !important; }
.bg-accent { background-color: var(--color-accent) !important; }
.bg-accent-dark { background-color: var(--color-accent-dark) !important; }
.bg-white { background-color: var(--color-white) !important; }

.border-primary { border-color: var(--color-border) !important; }
.border-accent { border-color: var(--color-accent) !important; }

/* Boutons cohérents */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: var(--color-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-accent-dark) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--color-background-secondary);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-gray-medium);
    color: var(--color-text-primary);
}

/* Cartes et conteneurs */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Classes d'animation */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out;
}

/* Effets de hover améliorés */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Boutons avec effet de gradient */
.btn-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

/* Header avec effet de glassmorphism */
.header-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Icônes avec effet de pulse */
.icon-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Gradient de fond personnalisé */
.gradient-bg {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: relative;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* Style pour la Hero Section */
.hero-section {
    background: white;
    position: relative;
}

/* Améliorations pour mobile et tablette */
@media (max-width: 640px) {
    /* Optimisations pour téléphones */
    .gradient-bg {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        min-height: 100vh;
    }
    
    /* Améliorer la lisibilité sur mobile */
    h1 {
        line-height: 1.1 !important;
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Espacement optimisé pour mobile */
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
    
    /* Boutons plus grands pour le touch */
    a[href*="wa.me"], a[href*="tel:"] {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn {
        padding: var(--spacing-lg) var(--spacing-xl);
        font-size: 1.1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Optimisations pour tablettes */
    .gradient-bg {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        min-height: 100vh;
    }
    
    /* Améliorer l'espacement sur tablette */
    .space-y-6 > * + * {
        margin-top: 1.5rem;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.25rem;
    }
}

/* Améliorations générales pour tous les écrans */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Optimisations pour les images */
img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* Optimisations spécifiques pour les images du site */
.hero-image {
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.3);
}

.service-image {
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.service-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.15);
}

/* Optimisations pour le chargement des images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Fallback pour les images non chargées */
img:not([src]), img[src=""] {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

img:not([src])::after, img[src=""]::after {
    content: "Image en cours de chargement...";
}

/* Améliorer l'accessibilité tactile */
button, a {
    touch-action: manipulation;
}

/* Optimisations pour les animations sur mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Effet de parallaxe pour les images */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Styles pour les formulaires */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    font-family: var(--font-family);
}

.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design amélioré */
@media (max-width: 768px) {
    .mobile-menu {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Styles pour les cartes de service */
.service-card {
    position: relative;
    overflow: hidden;
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.service-card::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;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Effet de focus pour l'accessibilité */
.focus-visible:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Styles pour les icônes de contact */
.contact-icon {
    transition: all 0.3s ease;
    background: var(--color-gray-medium);
    border-radius: var(--border-radius-lg);
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-icon:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--color-accent);
    color: var(--color-white);
}

@media (min-width: 640px) {
    .contact-icon {
        width: 4rem;
        height: 4rem;
        font-size: 1.375rem;
    }
}

@media (min-width: 1024px) {
    .contact-icon {
        width: 5rem;
        height: 5rem;
        font-size: 1.5rem;
    }
}

/* Effet de texte dégradé */
.text-gradient {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Styles pour les badges */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-white);
}

/* Effet de scroll smooth personnalisé */
html {
    scroll-behavior: smooth;
}

/* Lignes de connexion ondulées */
.connection-line {
    position: relative;
}

.connection-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gray-medium) 50%, transparent 100%);
    transform: translateY(-50%);
}

.connection-line svg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
}

/* Animation pour les lignes de connexion */
@keyframes wave {
    0%, 100% { transform: translateY(-50%) scaleX(1); }
    50% { transform: translateY(-50%) scaleX(1.1); }
}

.connection-line svg {
    animation: wave 3s ease-in-out infinite;
}

/* Styles pour les tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Styles pour les notifications */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: var(--color-accent);
}

/* Styles pour les modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: var(--border-radius-xl);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Styles pour la section contact */
.contact-map {
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.contact-card {
    background: var(--color-background-secondary);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-height: 120px;
}

@media (min-width: 640px) {
    .contact-card {
        padding: var(--spacing-xl);
        min-height: 130px;
    }
}

@media (min-width: 1024px) {
    .contact-card {
        padding: var(--spacing-2xl);
        min-height: 140px;
    }
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer amélioré */
footer {
    background: var(--color-background-secondary);
    color: var(--color-text-secondary);
}

footer h3, footer h4 {
    color: var(--color-text-primary);
}

footer a {
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--color-accent);
}

/* Améliorations SEO et accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Optimisations pour les moteurs de recherche */
.structured-data {
    display: none;
}

/* Améliorations pour la performance */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Styles pour les liens externes */
.external-link::after {
    content: "↗";
    margin-left: 0.25rem;
    font-size: 0.75em;
}

/* Améliorations pour l'impression */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .gradient-bg {
        background: white !important;
        color: black !important;
    }
}
