@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;700;800&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero Carousel High-Spec Motion */
#hero-carousel .flex {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    transition: scroll-behavior 0.3s ease;
}

#hero-carousel .flex > div {
    scroll-snap-align: center;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.3s ease,
                box-shadow 0.3s ease;
    will-change: transform, opacity;
}

/* Combined Shake + Zoom animation for center cards - stays in place */
@keyframes shake-zoom {
    0%, 100% { transform: scale(1) translateY(0) rotate(0deg); }
    10% { transform: scale(1.08) translateY(8px) rotate(-2deg); }
    20% { transform: scale(1.08) translateY(8px) rotate(2deg); }
    30% { transform: scale(1.08) translateY(8px) rotate(-2deg); }
    40% { transform: scale(1.08) translateY(8px) rotate(2deg); }
    50% { transform: scale(1.08) translateY(8px) rotate(-1deg); }
    60% { transform: scale(1.08) translateY(8px) rotate(1deg); }
    70% { transform: scale(1.08) translateY(8px) rotate(-1deg); }
    80% { transform: scale(1.08) translateY(8px) rotate(1deg); }
    90% { transform: scale(1.08) translateY(8px) rotate(0deg); }
}

#hero-carousel .flex > div.center-card {
    transform: scale(1.05);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Apply shake + zoom to center card images */
#hero-carousel .flex > div.center-card img.hero-card-image,
#hero-carousel .flex > div.center-card .flex img,
#hero-carousel .flex > div.center-card img {
    animation: shake-zoom 0.6s ease-in-out !important;
    transform-origin: center bottom !important;
}

#hero-carousel .flex > div:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Enhanced Header Pattern */
.header-bg-pattern {
    background: linear-gradient(135deg, #FF5200 0%, #FF8C00 100%);
    position: relative;
    overflow: hidden;
}

.header-bg-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}

.header-bg-pattern::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
    filter: blur(10px);
}

/* Glassmorphism Card Style */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.dark .glass-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.hero-card-image {
    transition: transform 0.5s ease;
}

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

/* New Search Bar Styles */
.search-container {
  position: relative;
  width: 100%;
}

.search-main {
  position: relative;
  border: none;
  height: 45px;
  background: rgba(255, 255, 255, 0.95);
  width: 100%;
  border-radius: 16px;
  padding-left: 45px;
  padding-right: 20px;
  font-size: 14px;
  color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.search-main:focus {
  outline: none;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* Language Toggle Button */
.language-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    pointer-events: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.4s;
    border-radius: 34px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

/* Flag states */
.lang-en .slider { background-image: url('https://cdn-icons-png.freepik.com/256/197/197374.png'); }
.lang-fr .slider { background-image: url('https://cdn-icons-png.freepik.com/256/14010/14010011.png'); }
.lang-ar .slider { background-image: url('https://img.icons8.com/color/256/morocco.png'); }

#current-language {
    margin-left: 8px;
    margin-right: 8px;
    font-size: 12px;
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Header Buttons */
.header-btn {
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

.header-btn:active {
    transform: scale(0.95);
}

/* RTL Support */
[dir="rtl"] #current-language { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .absolute.-right-4 { right: auto !important; left: -1rem !important; }
[dir="rtl"] .absolute.right-3 { right: auto !important; left: 0.75rem !important; }
[dir="rtl"] .overflow-x-auto { direction: rtl; }
[dir="rtl"] .flex { direction: rtl; }
[dir="rtl"] #hero-carousel .flex > div { text-align: right; }
[dir="rtl"] #hero-carousel .items-start { align-items: flex-start; }
[dir="rtl"] .absolute.top-3.right-4 { right: auto !important; left: 1rem !important; }
[dir="rtl"] .absolute.top-3.md\:right-8 { right: auto !important; left: 2rem !important; }
