/* ============================================
   Htaldark Design System v3.0
   Premium CSS for Morocco's #1 Delivery App
   ============================================ */

/* Reset & Base */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================
   Glassmorphism Utilities 
   ======================== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-dark {
    background: rgba(2, 48, 71, 0.85);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ========================
   Premium Animations
   ======================== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-14px);
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

@keyframes morph {

    0%,
    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(251, 133, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(251, 133, 0, 0.6);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animate-float {
    animation: float 5s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.animate-morph {
    animation: morph 10s ease-in-out infinite both alternate;
}

.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-glow {
    animation: glow-pulse 3s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

/* Stagger 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;
}

/* ========================
   Text Effects
   ======================== */
.text-gradient {
    background: linear-gradient(135deg, #023047 0%, #fb8500 50%, #ffb703 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-light {
    background: linear-gradient(135deg, #fb8500, #ffb703);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shimmer {
    background: linear-gradient(90deg, #023047, #fb8500, #023047);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

/* ========================
   Image Helpers
   ======================== */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-zoom {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.img-zoom:hover {
    transform: scale(1.08);
}

/* ========================
   Premium Shadows
   ======================== */
.shadow-brand {
    box-shadow: 0 20px 60px -15px rgba(2, 48, 71, 0.25);
}

.shadow-orange {
    box-shadow: 0 20px 60px -15px rgba(251, 133, 0, 0.35);
}

.shadow-soft {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

.shadow-glass {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ========================
   Blob shapes (organic)
   ======================== */
.blob {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 10s ease-in-out infinite both alternate;
}

/* ========================
   Noise Texture Overlay
   ======================== */
.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========================
   RTL Adjustments
   ======================== */
html[dir="rtl"] .ltr\:mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

html[dir="rtl"] .ltr\:ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

/* ========================
   Premium Scrollbar
   ======================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fb8500, #ffb703);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #e07a00, #fb8500);
}

/* Chatbot Scrollbar */
#chat-messages::-webkit-scrollbar {
    width: 5px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 100px;
}

/* ========================
   Intersection Observer
   ======================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}