/* ============================================
   iCampMaroc — Design System v5
   Clean, minimal, premium travel platform
   ============================================ */

/* ---------- Custom Properties ---------- */
:root {
    --primary: #338255;
    --primary-dark: #1f5436;
    --primary-light: #69d397;
    --secondary: #d39544;
    --dark: #101828;
    --dark-700: #344054;
    --whatsapp: #25D366;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #98a2b3; }

/* ---------- Selection ---------- */
::selection { background: rgba(51, 130, 85, 0.15); color: inherit; }

/* ---------- Focus ---------- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- Page Transition ---------- */
main { animation: pageIn var(--duration) ease-out; }
@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Cards ---------- */
.card-hover {
    transition: box-shadow var(--duration) var(--ease);
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
}

.card-hover-subtle {
    transition: box-shadow var(--duration) var(--ease);
}
.card-hover-subtle:hover {
    box-shadow: var(--shadow-md);
}

/* ---------- Buttons ---------- */
.btn-hover {
    transition: background-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.btn-hover:hover {
    filter: brightness(0.92);
    box-shadow: var(--shadow-sm);
}

/* ---------- Text Gradient ---------- */
.text-gradient {
    background: linear-gradient(135deg, #338255, #69d397, #d39544);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Load Animations ---------- */
.animate-on-load { opacity: 0; }

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ---------- Flash Messages ---------- */
.flash-enter { animation: slideIn 250ms ease-out; }
.flash-leave { animation: slideOut 200ms ease-in forwards; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* ---------- Glass (navbar only) ---------- */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.glass-hover {
    transition: background var(--duration) var(--ease);
}
.glass-hover:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ---------- Navbar ---------- */
.nav-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: padding var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.nav-scrolled {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}
.nav-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

/* ---------- Page Hero ---------- */
.page-hero {
    position: relative;
    overflow: hidden;
}

/* ---------- Section Badge ---------- */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---------- Image Zoom ---------- */
.img-zoom { overflow: hidden; }
.img-zoom img {
    transition: transform 400ms var(--ease);
}
.img-zoom:hover img {
    transform: scale(1.04);
}

/* ---------- Testimonial Cards ---------- */
.testimonial-card {
    transition: box-shadow var(--duration) var(--ease);
}
.testimonial-card:hover {
    box-shadow: var(--shadow-md);
}
.testimonial-avatar {
    transition: box-shadow var(--duration) var(--ease);
}
.testimonial-card:hover .testimonial-avatar {
    box-shadow: 0 0 0 3px rgba(51, 130, 85, 0.12);
}
.star-rating { color: #f59e0b; letter-spacing: 2px; }

/* ---------- Feature Icon ---------- */
.feature-icon {
    transition: transform var(--duration) var(--ease);
}
.feature-icon:hover,
.card-hover-subtle:hover .feature-icon {
    transform: scale(1.05);
}

/* ---------- Destination Cards ---------- */
.destination-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.destination-card .dest-overlay {
    transition: background var(--duration) var(--ease);
}
.destination-card:hover .dest-overlay {
    background: linear-gradient(to top, rgba(31, 84, 54, 0.85) 0%, rgba(15, 23, 42, 0.15) 60%, transparent 100%);
}

/* ---------- Vehicle Cards ---------- */
.vehicle-card .vehicle-img img {
    transition: transform 400ms var(--ease);
}
.vehicle-card:hover .vehicle-img img {
    transform: scale(1.04);
}

/* ---------- Form Focus ---------- */
.focus-enhanced:focus {
    border-color: #3aaf6d;
    box-shadow: 0 0 0 3px rgba(58, 175, 109, 0.1);
}

/* ---------- Newsletter Input ---------- */
.newsletter-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.newsletter-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(58, 175, 109, 0.4);
    box-shadow: 0 0 0 3px rgba(58, 175, 109, 0.1);
    outline: none;
}

/* ---------- Footer ---------- */
.footer-glow::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.4;
}
.footer-link {
    transition: color var(--duration) var(--ease);
}
.footer-link:hover {
    color: white;
}
html[dir="rtl"] .footer-link:hover {
    color: white;
}
.social-link {
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

/* ---------- Contact Cards ---------- */
.contact-card {
    transition: box-shadow var(--duration) var(--ease);
}
.contact-card:hover {
    box-shadow: var(--shadow-md);
}
.contact-card:hover .contact-icon {
    background-color: var(--primary);
    color: white;
}
.contact-icon {
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

/* ---------- WhatsApp & Back to Top ---------- */
/* Styles now handled via Tailwind utility classes in base.html */

/* ---------- Stat Cards ---------- */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: background-color var(--duration) var(--ease);
}
.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ---------- CTA ---------- */
.cta-enhanced {
    position: relative;
    overflow: hidden;
}

/* ---------- Price Tag ---------- */
.price-tag { position: relative; display: inline-block; }

/* ---------- Search Button ---------- */
.search-btn-shine {
    transition: box-shadow var(--duration) var(--ease);
}
.search-btn-shine:hover {
    box-shadow: 0 6px 20px rgba(51, 130, 85, 0.25);
}

/* ---------- Dropdown Stagger ---------- */
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-stagger > * {
    animation: dropIn 200ms var(--ease) forwards;
    opacity: 0;
}
.dropdown-stagger > *:nth-child(1) { animation-delay: 0ms; }
.dropdown-stagger > *:nth-child(2) { animation-delay: 25ms; }
.dropdown-stagger > *:nth-child(3) { animation-delay: 50ms; }
.dropdown-stagger > *:nth-child(4) { animation-delay: 75ms; }
.dropdown-stagger > *:nth-child(5) { animation-delay: 100ms; }
.dropdown-stagger > *:nth-child(6) { animation-delay: 125ms; }
.dropdown-stagger > *:nth-child(7) { animation-delay: 150ms; }
.dropdown-stagger > *:nth-child(8) { animation-delay: 175ms; }

/* ---------- Timeline ---------- */
.timeline-connector { position: relative; }
.timeline-connector::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 100%;
    width: 100%;
    height: 2px;
    border-top: 2px dashed #cbf6df;
}
html[dir="rtl"] .timeline-connector::after { left: auto; right: 100%; }
@media (max-width: 768px) { .timeline-connector::after { display: none; } }

/* ---------- Link Arrow ---------- */
.link-arrow i { transition: transform var(--duration) var(--ease); }
.link-arrow:hover i { transform: translateX(3px); }
html[dir="rtl"] .link-arrow:hover i { transform: translateX(-3px); }

/* ---------- Scroll Reveal ---------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
.stagger-1 { transition-delay: 50ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 150ms; }
.stagger-4 { transition-delay: 200ms; }
.stagger-5 { transition-delay: 250ms; }
.stagger-6 { transition-delay: 300ms; }

/* ---------- Badge Pulse (subtle) ---------- */
.badge-pulse {
    animation: subtlePulse 4s ease-in-out infinite;
}
@keyframes subtlePulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* ---------- Dot Pattern ---------- */
.dot-pattern {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ---------- Wave Dividers ---------- */
.wave-divider {
    position: absolute;
    bottom: -1px; left: 0;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    z-index: 3;
}
.wave-divider svg { display: block; width: 100%; height: 50px; }

.wave-divider-top {
    position: absolute;
    top: -1px; left: 0;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    transform: rotate(180deg);
    z-index: 3;
}
.wave-divider-top svg { display: block; width: 100%; height: 50px; }

/* ---------- RTL ---------- */
html[dir="rtl"] [data-aos="fade-right"] { transform: translate3d(-50px, 0, 0); }
html[dir="rtl"] [data-aos="fade-left"] { transform: translate3d(50px, 0, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .wave-divider svg, .wave-divider-top svg { height: 30px; }
    .stat-card { padding: 16px; }
}

@media (max-width: 480px) {
    .wave-divider svg, .wave-divider-top svg { height: 20px; }
    .stat-card { padding: 12px; }
    .search-tab { min-height: 48px; }
}

/* ---------- Safe Area ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- Print ---------- */
@media print {
    .nav-glass,
    nav,
    [aria-label="WhatsApp"],
    [aria-label="Back to top"] { display: none !important; }
    body { font-size: 12pt; color: #000; }
    a { color: #000; text-decoration: underline; }
    .shadow-sm, .shadow-md, .shadow-lg { box-shadow: none !important; }
}

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