/* ===== VARIABLES & BASE ===== */

/* Initial hidden state for animated elements - prevents flash on load */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
}

/* Immediately show hero elements (above the fold) */
[data-animate-hero] {
    opacity: 1;
    transform: none;
}

:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

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

html {
    overflow-x: hidden;
    /* Smooth scroll handled by JavaScript for better control */
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--slate-800);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll on mobile */
html, body {
    overscroll-behavior-x: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--emerald-500);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--emerald-600);
}

/* ===== GLASS EFFECT ===== */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== GRADIENT MESH BACKGROUND ===== */
.gradient-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 30%, rgba(139, 92, 246, 0.04) 0%, transparent 40%),
        linear-gradient(180deg, var(--slate-50) 0%, #ffffff 50%, var(--slate-50) 100%);
}

/* ===== ANIMATED GRADIENT ORBS ===== */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(20, 184, 166, 0.08) 100%);
    top: 50%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ===== NAVIGATION ===== */
.nav-link {
    position: relative;
    color: var(--slate-600);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--emerald-500), var(--emerald-600));
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover {
    color: var(--emerald-600);
}

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

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--emerald-500) 0%, var(--emerald-600) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px -10px rgba(16, 185, 129, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    color: var(--slate-800);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 9999px;
    border: 1px solid var(--slate-200);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--emerald-600);
    font-weight: 600;
    border: 2px solid var(--emerald-600);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--emerald-600);
    color: white;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

/* ===== FORM STYLES ===== */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--slate-50);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--slate-800);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    background: white;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: var(--slate-400);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: #ef4444;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 140px;
    padding: 1.5rem;
    border: 2px dashed var(--slate-300);
    border-radius: 1rem;
    background: var(--slate-50);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.05);
}

.file-upload.dragover {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.1);
}

.file-upload-icon {
    width: 3rem;
    height: 3rem;
    color: var(--slate-400);
    margin-bottom: 0.75rem;
}

.file-upload-text {
    text-align: center;
    color: var(--slate-500);
    font-size: 0.875rem;
}

.file-upload-text strong {
    color: var(--emerald-600);
}

/* ===== SECTION STYLES ===== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--slate-500);
    max-width: 600px;
    margin: 0 auto;
}

.section-divider {
    width: 4rem;
    height: 4px;
    background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400));
    border-radius: 2px;
    margin: 1.5rem auto 0;
}

/* ===== MAP CONTAINER ===== */
.map-container {
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 4px solid white;
}

/* ===== TRANSPORT BADGES ===== */
.transport-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.metro-badge {
    background: #7BC4D3;
    color: #1a1a1a;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: 800;
    min-width: 2.5rem;
    text-align: center;
    display: inline-block;
}

.rer-badge {
    background: #FFCD00;
    color: #1a1a1a;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    min-width: 2.5rem;
    text-align: center;
    display: inline-block;
}

.bus-badge {
    background: #6ECA97;
    color: #1a1a1a;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: 800;
    min-width: 2.5rem;
    text-align: center;
    display: inline-block;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-wiggle:hover {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Stagger animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* Hover animations */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Shimmer effect for loading or accent */
.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Pulse ring effect */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: -1;
}

/* Text gradient animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Icon animations */
.icon-bounce:hover i,
.icon-bounce:hover svg {
    animation: bounce-soft 0.6s ease;
}

/* Card reveal animation */
.card-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Underline animation */
.animated-underline {
    position: relative;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-underline:hover::after {
    width: 100%;
}

/* ===== SOCIAL LINKS ===== */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--slate-800);
    border-radius: 0.5rem;
    color: var(--slate-400);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--emerald-600);
    color: white;
    transform: translateY(-2px);
}

/* ===== DOCTOLIB CARD ===== */
.doctolib-card {
    background: linear-gradient(135deg, #0596DE 0%, #047ABD 100%);
    border-radius: 1.5rem;
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.doctolib-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    .gradient-orb {
        opacity: 0.3;
    }
}

/* ===== LOADING STATES ===== */
.btn-loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== SUCCESS/ERROR STATES ===== */
.form-success {
    background: var(--emerald-50);
    border: 1px solid var(--emerald-200);
    color: var(--emerald-800);
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
