/* ═══════════════════════════════════════════════════════════════════
   FTIM 2026 — Custom Styles
   Forum Touristique International de Mauritanie
   ═══════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
    --ftim-blue: #011C40;
    --ftim-blue-dark: #0B438C;
    --ftim-orange: #E8742C;
    --ftim-orange-dark: #C4611C;
    --ftim-yellow: #F8E71C;
    --ftim-green: #7ED321;
    --ftim-cyan: #50E3C2;
    --ftim-sand: #F5F0E8;
    --ftim-charcoal: #2C3E50;
    --ftim-warm-gray: #8B7E74;
    --nav-transition-speed: 0.4s;
}

/* ─── Smooth Scroll ─── */
html {
    scroll-behavior: smooth;
}

/* ─── Navbar States ─── */
#navbar {
    background: transparent;
    transition: background var(--nav-transition-speed) ease,
                box-shadow var(--nav-transition-speed) ease,
                backdrop-filter var(--nav-transition-speed) ease;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

/* Navbar link colors — transparent state (over hero) */
.nav-link {
    color: white;
    transition: color var(--nav-transition-speed) ease;
}

.navbar-logo-text {
    color: white;
    transition: color var(--nav-transition-speed) ease;
}

/* Navbar link colors — scrolled state */
#navbar.scrolled .nav-link {
    color: var(--ftim-charcoal);
}

#navbar.scrolled .nav-link-active {
    color: var(--ftim-blue-dark);
    background: rgba(11, 67, 140, 0.08);
}

/* Active nav on transparent (homepage hero) */
.nav-link-active {
    position: relative;
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--ftim-orange);
    border-radius: 1px;
}

#navbar.scrolled .navbar-logo-text {
    color: var(--ftim-charcoal);
}

#navbar.scrolled .nav-link:hover {
    color: var(--ftim-blue);
}

/* Mobile: always solid white navbar — no transparency on small screens */
@media (max-width: 767px) {
    body:not(.page-inner) #navbar {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
    }
    body:not(.page-inner) #navbar .nav-link {
        color: var(--ftim-charcoal);
    }
    body:not(.page-inner) #navbar .navbar-logo-text {
        color: var(--ftim-charcoal);
    }
}

/* Pages without hero (non-homepage) get dark navbar immediately */
body.page-inner #navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

body.page-inner .nav-link {
    color: var(--ftim-charcoal);
}

body.page-inner .navbar-logo-text {
    color: var(--ftim-charcoal);
}

body.page-inner .nav-link:hover {
    color: var(--ftim-blue);
}

/* ─── Animations ─── */

/* Fade in from below */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.7s ease-out forwards;
    opacity: 0;
}

/* Staggered 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; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right (for RTL) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

[dir="rtl"] .animate-slide-in-left {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ─── Countdown Timer ─── */
.countdown-digit {
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ─── Hero Section ─── */
.hero-gradient {
    background: linear-gradient(
        135deg,
        rgba(1, 28, 64, 0.85) 0%,
        rgba(11, 67, 140, 0.7) 50%,
        rgba(232, 116, 44, 0.6) 100%
    );
}

/* Geometric decorative pattern for sections */
.pattern-overlay {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(11, 67, 140, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(232, 116, 44, 0.05) 0%, transparent 50%);
}

/* Sand texture background */
.bg-sand-texture {
    background-color: var(--ftim-sand);
    background-image:
        radial-gradient(ellipse at 10% 90%, rgba(232, 116, 44, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 10%, rgba(11, 67, 140, 0.06) 0%, transparent 60%);
}

/* ─── Cards ─── */
.card-hover {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Theme cards icon background */
.theme-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.card-hover:hover .theme-icon {
    transform: scale(1.1) rotate(-3deg);
}

/* ─── Buttons ─── */
.btn-primary {
    background-color: var(--ftim-orange);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--ftim-orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 116, 44, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

/* ─── Form Styles ─── */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E8DFD0;
    border-radius: 0.75rem;
    background: white;
    color: var(--ftim-charcoal);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--ftim-blue-dark);
    box-shadow: 0 0 0 4px rgba(11, 67, 140, 0.1);
}

.form-input::placeholder {
    color: var(--ftim-warm-gray);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ftim-charcoal);
    margin-bottom: 0.5rem;
}

.form-error {
    color: #E74C3C;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ─── Section Divider ─── */
.section-divider {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ftim-blue), var(--ftim-orange));
    margin: 0 auto;
}

[dir="rtl"] .section-divider {
    background: linear-gradient(270deg, var(--ftim-blue), var(--ftim-orange));
}

/* ─── Gallery Lightbox ─── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

/* ─── RTL-specific adjustments ─── */
[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

/* Flip directional icons in RTL */
[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--ftim-warm-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ftim-blue);
}

/* ─── Selection ─── */
::selection {
    background-color: rgba(11, 67, 140, 0.3);
    color: #011C40;
}

::-moz-selection {
    background-color: rgba(11, 67, 140, 0.3);
    color: #011C40;
}

/* Dark sections — use orange highlight so white text stays visible */
.bg-ftim-charcoal ::selection,
#hero ::selection,
#objectives ::selection,
#cta ::selection,
footer ::selection {
    background-color: rgba(232, 116, 44, 0.4);
    color: #ffffff;
}

.bg-ftim-charcoal ::-moz-selection,
#hero ::-moz-selection,
#objectives ::-moz-selection,
#cta ::-moz-selection,
footer ::-moz-selection {
    background-color: rgba(232, 116, 44, 0.4);
    color: #ffffff;
}

/* ─── Print ─── */

/* ─── Sponsors Marquee ─── */
.sponsors-outer {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.sponsors-track {
    display: flex;
    align-items: center;
    gap: 5rem;
    width: max-content;
    padding: 1rem 0;
}

.sponsors-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.sponsors-item:hover {
    opacity: 0.7;
}

.sponsors-outer:hover .sponsors-track {
    animation-play-state: paused;
}

@media print {
    #navbar, footer, .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in-up,
    .animate-slide-in-left,
    .animate-scale-in,
    .reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .card-hover:hover {
        transform: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
