/* =====================================================
   Miwada - Custom Styles
   Ateliers de Cuisine Béninoise pour Entreprises
   ===================================================== */

/* =====================================================
   African Pattern Background
   ===================================================== */
.african-pattern {
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(228, 106, 51, 0.1) 35px, rgba(228, 106, 51, 0.1) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(193, 69, 51, 0.1) 35px, rgba(193, 69, 51, 0.1) 70px);
    background-size: 100px 100px;
}

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

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

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

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

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

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

.animate-fade-in-delay {
    animation: fadeInDelay 1s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-slide-in {
    animation: slideInFromBottom 0.6s ease-out forwards;
}

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

/* =====================================================
   Smooth Scrolling
   ===================================================== */
html {
    scroll-behavior: smooth;
}

/* =====================================================
   Custom Scrollbar
   ===================================================== */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #E86A33, #C14533);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #C14533, #E86A33);
}

/* =====================================================
   Navigation Enhancements
   ===================================================== */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, #E86A33, #C14533);
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* =====================================================
   Hero Section Enhancements
   ===================================================== */
#accueil {
    background: 
        radial-gradient(circle at 20% 80%, rgba(228, 106, 51, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(74, 124, 89, 0.05) 0%, transparent 50%),
        #FFF8F0;
}

/* =====================================================
   Button Hover Effects
   ===================================================== */
button, a {
    transition: all 0.3s ease;
}

.group:hover .group-hover\:translate-x-1 {
    transform: translateX(4px);
}

/* =====================================================
   Card Hover Effects
   ===================================================== */
.hover\:shadow-2xl:hover {
    box-shadow: 0 25px 50px -12px rgba(139, 90, 60, 0.25);
}

/* =====================================================
   Form Styling
   ===================================================== */
input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: #E86A33;
    box-shadow: 0 0 0 3px rgba(228, 106, 51, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #9CA3AF;
    opacity: 0.6;
}

/* =====================================================
   Gallery Hover Effects
   ===================================================== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Hide Gemini watermarks in bottom right corner */
#galerie img {
    position: relative;
}

#galerie .group::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 50%, rgba(139, 90, 60, 0.95) 50%);
    pointer-events: none;
    z-index: 1;
}

/* =====================================================
   Scroll Top Button
   ===================================================== */
#scroll-top {
    transition: all 0.3s ease;
}

#scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#scroll-top:hover {
    transform: translateY(-3px);
}

/* =====================================================
   Section Spacing
   ===================================================== */
section {
    position: relative;
}

/* =====================================================
   Gradient Text
   ===================================================== */
.gradient-text {
    background: linear-gradient(135deg, #E86A33, #C14533, #D4A537);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =====================================================
   African Pattern Overlay
   ===================================================== */
.pattern-overlay {
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(228, 106, 51, 0.03) 10px,
            rgba(228, 106, 51, 0.03) 20px
        );
}

/* =====================================================
   Stats Counter Animation
   ===================================================== */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* =====================================================
   Mobile Menu Styles
   ===================================================== */
#mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
}

/* =====================================================
   Loading States
   ===================================================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =====================================================
   Success Message Animation
   ===================================================== */
#form-success {
    animation: slideInFromBottom 0.5s ease-out forwards;
}

/* =====================================================
   Image Loading
   ===================================================== */
img {
    transition: opacity 0.3s ease;
}

img.loading {
    opacity: 0.5;
}

/* =====================================================
   Responsive Typography
   ===================================================== */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    nav, footer, #scroll-top, #mobile-menu-btn {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* =====================================================
   Accessibility
   ===================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #E86A33;
    outline-offset: 2px;
}

/* =====================================================
   Enhanced Testimonial Cards
   ===================================================== */
#testimonials .bg-white {
    position: relative;
    overflow: hidden;
}

#testimonials .bg-white::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 120px;
    font-family: 'Playfair Display', serif;
    color: rgba(228, 106, 51, 0.1);
    line-height: 1;
}

/* =====================================================
   Hero Image Grid Animations
   ===================================================== */
#accueil .grid img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#accueil .grid > div:nth-child(1) {
    animation: fadeIn 1s ease-out 0.2s forwards;
    opacity: 0;
}

#accueil .grid > div:nth-child(2) {
    animation: fadeIn 1s ease-out 0.4s forwards;
    opacity: 0;
}

/* =====================================================
   Custom Badge Styles
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================
   Icon Animations
   ===================================================== */
.fa-star {
    transition: all 0.3s ease;
}

.fa-star:hover {
    transform: scale(1.2) rotate(15deg);
}

/* =====================================================
   Section Dividers
   ===================================================== */
section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(228, 106, 51, 0.2) 50%,
        transparent 100%
    );
}

section:last-of-type::after {
    display: none;
}

/* =====================================================
   Floating Elements
   ===================================================== */
.floating-badge {
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   Team Building Cards Special Effects
   ===================================================== */
#team-building .group {
    position: relative;
    overflow: hidden;
}

#team-building .group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(228, 106, 51, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

#team-building .group:hover::before {
    left: 100%;
}

/* =====================================================
   Footer Styling
   ===================================================== */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #E86A33;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* =====================================================
   Color Utilities
   ===================================================== */
.text-gradient-orange {
    background: linear-gradient(135deg, #E86A33, #C14533);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #D4A537, #E86A33);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =====================================================
   Enhanced Form States
   ===================================================== */
input:valid,
select:valid,
textarea:valid {
    border-color: #4A7C59;
}

input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #C14533;
}

/* =====================================================
   Performance Optimizations
   ===================================================== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* =====================================================
   Dark Mode Support (Optional)
   ===================================================== */
@media (prefers-color-scheme: dark) {
    /* If you want to add dark mode support in the future */
}

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