:root {
    --primary: #1a2a3a;
    --accent: #c5a059;
    --light: #f8f9fa;
}

body {
    font-family: 'Montserrat', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--light);
    color: var(--primary);
}

.font-serif { 
    font-family: 'Playfair Display', serif; 
}

.font-arabic { 
    font-family: 'Amiri', serif; 
}

/* Navigation */
.nav-link {
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

.nav-link:hover::after { 
    width: 100%; 
}

/* Navigation Scroll State */
#main-nav {
    transition: all 0.3s ease;
}

/* Default state - on hero (transparent bg, white text) */
nav#main-nav .nav-text-color {
    color: #ffffff !important;
}

nav#main-nav .nav-subtitle-color {
    color: rgba(255, 255, 255, 0.7) !important;
}

nav#main-nav .nav-link {
    color: #ffffff !important;
}

nav#main-nav #mobile-menu-btn,
nav#main-nav #mobile-menu-btn svg {
    color: #ffffff !important;
}

/* Scrolled state - on white sections (white bg, dark text) */
nav#main-nav.nav-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

nav#main-nav.nav-scrolled .nav-text-color {
    color: #1a2a3a !important;
}

nav#main-nav.nav-scrolled .nav-subtitle-color {
    color: #6b7280 !important;
}

nav#main-nav.nav-scrolled .nav-link {
    color: #1a2a3a !important;
}

nav#main-nav.nav-scrolled #mobile-menu-btn,
nav#main-nav.nav-scrolled #mobile-menu-btn svg {
    color: #1a2a3a !important;
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(rgba(15, 25, 35, 0.85), rgba(15, 25, 35, 0.75)),
                url('../images/herobg.jpg') center/cover no-repeat fixed;
    transition: background 1.5s ease-in-out;
    position: relative;
}

/* Fallback if no hero image */
.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a2a3a 0%, #2d3e50 100%);
    z-index: -1;
}

/* Services Cards */
.service-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-bottom: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

/* RTL Support */
[dir="rtl"] { 
    text-align: right; 
}

[dir="rtl"] .nav-link::after { 
    left: auto; 
    right: 0; 
}

[dir="rtl"] .flex.items-center.space-x-4 {
    flex-direction: row-reverse;
}

[dir="rtl"] .space-x-10 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 2.5rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 1rem;
    margin-left: 0;
}

/* Loading Animation */
.loading-shimmer {
    background: linear-gradient(90deg, #1a2a3a 25%, #233446 50%, #1a2a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mission Image - Photo Avocat avec Effets Thématiques */
#mission-img {
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    filter: sepia(0.15) contrast(1.1) brightness(0.92) saturate(0.85);
    object-fit: cover;
    object-position: center top;
}

#mission-img-container {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(197, 160, 89, 0.3);
}

#mission-img-container:hover #mission-img {
    transform: scale(1.03);
    filter: sepia(0.05) contrast(1.15) brightness(0.98) saturate(1);
}

/* Overlay dégradé doré/sombre permanent pour intégration au thème */
#mission-img-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg, 
        rgba(26, 42, 58, 0.1) 0%, 
        transparent 30%,
        transparent 60%,
        rgba(197, 160, 89, 0.2) 85%,
        rgba(26, 42, 58, 0.5) 100%
    );
    transition: all 0.6s ease;
    pointer-events: none;
    z-index: 5;
}

#mission-img-container:hover::after {
    background: linear-gradient(
        180deg, 
        rgba(26, 42, 58, 0.05) 0%, 
        transparent 30%,
        transparent 70%,
        rgba(197, 160, 89, 0.15) 90%,
        rgba(26, 42, 58, 0.3) 100%
    );
}

/* Effet de vignette dorée subtile professionnelle */
#mission-img-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(26, 42, 58, 0.4) 100%);
    box-shadow: inset 0 0 80px rgba(197, 160, 89, 0.08);
    z-index: 5;
    pointer-events: none;
}

/* Bordure et ombre dorées */
#mission-img-container {
    box-shadow: 
        0 0 0 1px rgba(197, 160, 89, 0.2),
        0 25px 50px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(197, 160, 89, 0.05);
    transition: all 0.6s ease;
}

#mission-img-container:hover {
    border-color: rgba(197, 160, 89, 0.5);
    box-shadow: 
        0 0 0 2px rgba(197, 160, 89, 0.3),
        0 35px 70px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(197, 160, 89, 0.08);
}

/* Form Messages */
.form-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Mobile Menu */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .flex.flex-col.md\:flex-row {
        flex-direction: column-reverse;
    }
    
    .hero-gradient {
        background-attachment: scroll;
    }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Mobile Navigation */
@media (max-width: 768px) {
    nav .max-w-7xl {
        padding: 1rem 1rem;
    }
    
    nav .text-2xl {
        font-size: 1.25rem;
    }
    
    #mobile-menu a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    #mobile-menu .px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Mobile Hero Section */
@media (max-width: 768px) {
    #home {
        min-height: 100vh;
        padding: 6rem 1.25rem 3rem;
    }
    
    #hero-title {
        font-size: 2.25rem !important;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }
    
    #hero-sub {
        font-size: 0.65rem;
        letter-spacing: 0.2em;
        margin-bottom: 1rem;
    }
    
    #hero-desc {
        font-size: 1rem !important;
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }
    
    #home .flex.flex-col a {
        padding: 1rem 2rem;
        font-size: 0.65rem;
        width: 100%;
        text-align: center;
    }
}

/* Mobile Services Section */
@media (max-width: 768px) {
    #services {
        padding: 4rem 0;
    }
    
    #services .max-w-7xl {
        padding: 0 1rem;
    }
    
    #services .text-center.mb-20 {
        margin-bottom: 2.5rem;
    }
    
    #serv-title {
        font-size: 1.75rem !important;
    }
    
    .service-card {
        padding: 1.5rem !important;
        margin-bottom: 0;
    }
    
    .service-card h4 {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .service-card p {
        font-size: 0.85rem !important;
    }
    
    .service-card svg {
        width: 2rem;
        height: 2rem;
    }
    
    .service-card .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    #services .grid {
        gap: 1rem !important;
    }
}

/* Mobile Mission/Profile Section */
@media (max-width: 768px) {
    #mission {
        padding: 3rem 0;
    }
    
    #mission .max-w-7xl {
        padding: 0 1rem;
    }
    
    #mission .grid {
        gap: 2rem !important;
    }
    
    #mission .relative.min-h-\[400px\] {
        min-height: 300px;
    }
    
    #mission-img-container {
        aspect-ratio: 3/4;
    }
    
    #mission .border.border-\[\#c5a059\]\/30 {
        display: none;
    }
    
    #mission-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    #mission-sub {
        font-size: 0.6rem;
        letter-spacing: 0.2em;
        margin-bottom: 1rem !important;
    }
    
    #mission-desc {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    #mission-content .grid {
        gap: 1rem !important;
    }
    
    #mission-content .text-sm {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
    }
}

/* Mobile Contact Section */
@media (max-width: 768px) {
    #contact {
        padding: 3rem 0;
    }
    
    #contact .max-w-6xl {
        padding: 0 1rem;
    }
    
    #contact .flex.flex-col {
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    }
    
    #contact .md\:w-5\/12,
    #contact .md\:w-7\/12 {
        width: 100%;
    }
    
    #contact .p-16 {
        padding: 2rem 1.5rem !important;
    }
    
    #contact-title {
        font-size: 1.75rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    #contact .space-y-12 {
        gap: 1.5rem;
    }
    
    #contact .space-y-12 > div {
        margin-top: 1.5rem;
    }
    
    #contact .space-y-12 > div:first-child {
        margin-top: 0;
    }
    
    #contact form input,
    #contact form textarea {
        padding: 0.875rem 0;
        font-size: 0.875rem;
    }
    
    #contact form .space-y-10 > * + * {
        margin-top: 1.5rem;
    }
    
    #form-submit {
        width: 100%;
        padding: 1rem 1.5rem !important;
        font-size: 0.65rem !important;
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    footer {
        padding: 3rem 0;
    }
    
    footer .text-3xl {
        font-size: 1.5rem;
    }
    
    footer .text-xs {
        font-size: 0.7rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    #hero-title {
        font-size: 1.875rem !important;
    }
    
    #hero-desc {
        font-size: 0.9rem !important;
    }
    
    .service-card {
        padding: 1.25rem !important;
    }
    
    #mission-title {
        font-size: 1.75rem !important;
    }
    
    #contact-title {
        font-size: 1.5rem !important;
    }
}

/* Touch-friendly buttons and links */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link {
        min-height: auto;
    }
}

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

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

/* ===== SCROLL ANIMATIONS ===== */
.animate-hidden {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for service cards */
.service-card.animate-hidden {
    transition-delay: 0s;
}

.service-card:nth-child(1).animate-visible { transition-delay: 0s; }
.service-card:nth-child(2).animate-visible { transition-delay: 0.1s; }
.service-card:nth-child(3).animate-visible { transition-delay: 0.2s; }
.service-card:nth-child(4).animate-visible { transition-delay: 0.3s; }
.service-card:nth-child(5).animate-visible { transition-delay: 0.4s; }
.service-card:nth-child(6).animate-visible { transition-delay: 0.5s; }

/* ===== PARALLAX HERO ===== */
.hero-gradient {
    background-attachment: fixed;
    will-change: background-position;
}

@media (max-width: 768px) {
    .hero-gradient {
        background-attachment: scroll;
    }
}

/* ===== BACK TO TOP BUTTON ===== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(197, 160, 89, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

#back-to-top:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(26, 42, 58, 0.4);
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 6rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
#whatsapp-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    min-width: 60px;
    max-width: 60px;
    min-height: 60px;
    max-height: 60px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
}

#whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

#whatsapp-btn svg {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    flex-shrink: 0;
}

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

.animate-pulse-once {
    animation: pulse-once 0.6s ease-in-out;
}

@media (max-width: 768px) {
    #whatsapp-btn {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        min-width: 50px;
        max-width: 50px;
        min-height: 50px;
        max-height: 50px;
    }
    
    #whatsapp-btn svg {
        width: 26px;
        height: 26px;
        min-width: 26px;
        max-width: 26px;
    }
}

/* ===== GOOGLE MAPS ===== */
#google-map {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    margin-top: 1.5rem;
    border: 2px solid rgba(197, 160, 89, 0.3);
}

@media (min-width: 768px) {
    #google-map {
        height: 200px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--light);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #b59049;
}

