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

:root {
    --adc-bg: #ffffff;
    --adc-bg-muted: #f8fafc;
    --adc-surface: #ffffff;
    --adc-surface-alt: #f1f5f9;
    --adc-border: #e2e8f0;
    --adc-text: #1e293b;
    --adc-text-muted: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--adc-text);
    background-color: var(--adc-bg);
    overflow-x: hidden;
    padding-top: 88px;
}

html,
body {
    width: 100%;
    max-width: 100%;
}

body {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 1024px) {
    body {
        padding-top: 96px;
    }
}

a {
    color: #2563eb;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes slideIn {
    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(-220px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(220px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(220px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 1.1s ease-out both;
}

.animate-slide-right {
    animation: slideInRight 1.1s ease-out both;
}

.animate-slide-up {
    animation: slideInUp 1.1s ease-out both;
}

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

.service-card-hidden {
    opacity: 0;
    visibility: hidden;
    will-change: transform, opacity;
    transform: translateY(40px);
}

.service-card-hidden[data-slide="left"] {
    transform: translateX(-80px);
}

.service-card-hidden[data-slide="right"] {
    transform: translateX(80px);
}

.service-card-hidden[data-slide="up"] {
    transform: translateY(140px);
}

/* Stabilize media blocks to avoid layout shift after animations */
.media-stable {
    width: 100%;
}

@supports (aspect-ratio: 1) {
    .media-stable {
        aspect-ratio: 4 / 3;
    }

    .media-stable img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* Responsive safety */
img {
    max-width: 100%;
    height: auto;
}

img,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

section {
    scroll-margin-top: 90px;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5ED6CC, #F4D160);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3BBDB4, #D9B446);
}

/* Selection */
::selection {
    background: #F4D160;
    color: #0f172a;
}

.bg-yellow-400,
.bg-adc-yellow {
    color: #0f172a !important;
}

/* Focus Styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #F4D160;
    outline-offset: 2px;
}

.keyboard-navigation *:focus {
    outline: 2px solid #F4D160 !important;
    outline-offset: 2px !important;
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.65);
}

/* Disable hover motion on touch devices to prevent scroll jumps */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover {
        transform: none;
        box-shadow: none;
    }

    .hover\:-translate-y-2:hover {
        transform: none;
    }

    .group:hover .group-hover\:scale-105 {
        transform: none;
    }
}

@media (max-width: 768px) {
    #services article,
    #portfolio .portfolio-card,
    #portfolio-grid .portfolio-item,
    #articles-en-vedette article {
        transition: none !important;
    }

    #services article:hover,
    #portfolio .portfolio-card:hover,
    #portfolio-grid .portfolio-item:hover,
    #articles-en-vedette article:hover,
    .hover-lift:hover,
    .hover\:-translate-y-2:hover,
    .group:hover .group-hover\:scale-105 {
        transform: none !important;
    }
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(94, 214, 204, 0.3);
}

.hero-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

@media (min-width: 640px) {
    .hero-logo {
        flex-direction: row;
        gap: 1.25rem;
    }
}

.hero-logo-img {
    max-width: 260px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 25px rgba(15, 23, 42, 0.2));
    border-radius: 9999px;
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-size: cover;
    mask-size: cover;
}

.hero-logo-left {
    animation: slideInLeft 0.8s ease-out both;
}

.hero-logo-right {
    animation: slideInRight 0.8s ease-out 0.15s both;
}

@media (max-width: 639px) {
    .hero-logo-left {
        transform: translateY(30px);
    }

    .hero-logo-right {
        transform: translateY(-10px);
    }
}

/* Form & Inputs */
label {
    color: var(--adc-text);
}

input,
textarea,
select {
    background: var(--adc-bg-muted);
    border: 1px solid var(--adc-border);
    color: var(--adc-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--adc-text-muted);
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Portfolio Filter Animation */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    visibility: hidden;
}

.portfolio-item.visible {
    opacity: 1;
    transform: scale(1);
    position: relative;
    visibility: visible;
}

/* FAQ Animation */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-content.show {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.faq-toggle svg {
    transition: transform 0.3s ease;
}

.faq-toggle.active svg {
    transform: rotate(180deg);
}

/* Form Validation Styles */
.form-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-success {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.form-error {
    background: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

/* 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: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #5ED6CC, #3BBDB4);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(94, 214, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(94, 214, 204, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #F4D160, #D9B446);
    color: #f8fafc;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(217, 180, 70, 0.35);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(217, 180, 70, 0.45);
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .text-responsive-4xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .text-responsive-3xl {
        font-size: 1.5rem;
        line-height: 1.3;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .bg-gradient-to-br {
        background: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000000;
    }
    
    .bg-gray-50 {
        background-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (Future Feature) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here when needed */
}

/* Custom Component Animations */
.stagger-animation > * {
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
