/* ============================================
   TASHEEL ALTHAKI - Modern UI/UX Styles
   ============================================ */

/* CSS Custom Properties for Theming */
:root {
    /* Colors - Light Mode */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-tertiary: #f1f5f9;
    --color-text-primary: #111111;
    --color-text-secondary: #4b5563;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;

    /* Brand Colors */
    --color-gold: #D4AF37;
    --color-gold-light: #E5C158;
    --color-gold-dark: #B4941F;
    --color-gold-rgb: 212, 175, 55;
    --color-tawjeeh: #b3590f;
    --color-dubai-economy: #005f66;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-gold: 0 4px 14px 0 rgba(212, 175, 55, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Dark Mode Variables */
.dark {
    --color-bg-primary: #0a0a0a;
    --color-bg-secondary: #111111;
    --color-bg-tertiary: #1a1a1a;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-muted: #9ca3af;
    --color-border: #2a2a2a;
    --color-border-light: #1f1f1f;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);

    --glass-bg: rgba(17, 17, 17, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   GLASSMORPHISM UTILITIES
   ============================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.glass-strong {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-subtle {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

.navbar-scrolled {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.navbar-scrolled.shrink {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Active nav link indicator */
.nav-link-active {
    position: relative;
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    border-radius: 2px;
}

/* Nav link hover effect */
.nav-link-hover {
    position: relative;
}

.nav-link-hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    border-radius: 2px;
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-link-hover:hover::after {
    width: 100%;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    z-index: 9999;
    transition: width 50ms linear;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #111111;
    font-weight: 600;
    overflow: hidden;
    transition: all var(--transition-base);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-outline-gold {
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    background: transparent;
    transition: all var(--transition-base);
}

.btn-outline-gold:hover {
    background: var(--color-gold);
    color: #111111;
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* Ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ============================================
   CARD STYLES
   ============================================ */

.card-modern {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    transition: all var(--transition-base);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-gold);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.card-glass:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Card 3D Tilt Effect (subtle) */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform var(--transition-base);
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
}

/* Gradient Border on Hover */
.card-gradient-border {
    position: relative;
    background: var(--color-bg-primary);
    border-radius: 16px;
    z-index: 1;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light), var(--color-gold-dark));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-gradient-border:hover::before {
    opacity: 1;
}

/* Icon Container Animation */
.icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.05));
    transition: all var(--transition-base);
}

.icon-container i {
    transition: transform var(--transition-base);
}

.card-modern:hover .icon-container {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
}

.card-modern:hover .icon-container i {
    color: #111111 !important;
    transform: scale(1.1);
}

/* ============================================
   FORM STYLES
   ============================================ */

/* Floating Label Input */
.form-group-float {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group-float input,
.form-group-float textarea,
.form-group-float select {
    width: 100%;
    padding: 1rem 1rem 0.5rem;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all var(--transition-base);
    color: var(--color-text-primary);
}

.form-group-float label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all var(--transition-fast);
    background: var(--color-bg-primary);
    padding: 0 0.25rem;
}

.form-group-float textarea ~ label {
    top: 1rem;
    transform: translateY(0);
}

.form-group-float input:focus,
.form-group-float textarea:focus,
.form-group-float select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 4px rgba(var(--color-gold-rgb), 0.1);
}

.form-group-float input:focus ~ label,
.form-group-float input:not(:placeholder-shown) ~ label,
.form-group-float textarea:focus ~ label,
.form-group-float textarea:not(:placeholder-shown) ~ label,
.form-group-float select:focus ~ label,
.form-group-float select:valid ~ label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-gold);
}

/* Input focus glow */
.input-glow:focus {
    box-shadow: 0 0 0 4px rgba(var(--color-gold-rgb), 0.15), 0 0 20px rgba(var(--color-gold-rgb), 0.1);
}

/* Form validation states */
.form-success {
    border-color: #10b981 !important;
}

.form-error {
    border-color: #ef4444 !important;
}

/* ============================================
   HERO STYLES
   ============================================ */

.hero-gradient-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(17, 17, 17, 0.8) 100%
    );
}

.hero-parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (max-width: 768px) {
    .hero-parallax {
        background-attachment: scroll;
    }
}

/* Scroll down indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
    opacity: 0.8;
    transition: opacity var(--transition-base);
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid currentColor;
    border-radius: 12px;
    position: relative;
}

.scroll-indicator-mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: currentColor;
    border-radius: 2px;
    animation: scrollMouse 1.5s ease-in-out infinite;
}

@keyframes scrollMouse {
    0%, 100% { opacity: 1; top: 8px; }
    50% { opacity: 0.5; top: 18px; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.slide-left {
    transform: translateX(50px);
}

.animate-on-scroll.slide-left.animated {
    transform: translateX(0);
}

.animate-on-scroll.slide-right {
    transform: translateX(-50px);
}

.animate-on-scroll.slide-right.animated {
    transform: translateX(0);
}

.animate-on-scroll.scale {
    transform: scale(0.9);
}

.animate-on-scroll.scale.animated {
    transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ============================================
   PAGE LOADER
   ============================================ */

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    border-top-color: var(--color-gold);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modern Loader Alternative */
.loader-dots {
    display: flex;
    gap: 8px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-gold);
    animation: loaderDots 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0; }

@keyframes loaderDots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 25%,
        var(--color-bg-secondary) 50%,
        var(--color-bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    min-width: 64px;
    min-height: 48px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--color-gold);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
}

/* Center action button */
.mobile-nav-action {
    position: relative;
    top: -20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
    transition: all var(--transition-base);
}

.mobile-nav-action:hover {
    transform: scale(1.1);
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--color-bg-tertiary);
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--color-border);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-gold);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.dark .theme-toggle::before {
    transform: translateX(24px);
}

.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    transition: opacity var(--transition-fast);
}

.theme-toggle-icon.sun {
    left: 5px;
    opacity: 1;
}

.theme-toggle-icon.moon {
    right: 5px;
    opacity: 0.5;
}

.dark .theme-toggle-icon.sun {
    opacity: 0.5;
}

.dark .theme-toggle-icon.moon {
    opacity: 1;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text gradient */
.text-gradient-gold {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand text colors */
.text-tawjeeh {
    color: var(--color-tawjeeh);
}

.text-dubai-economy {
    color: var(--color-dubai-economy);
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

/* Focus visible for accessibility */
.focus-visible:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ============================================
   DARK MODE SPECIFIC OVERRIDES
   ============================================ */

.dark .card-modern {
    background: var(--color-bg-secondary);
}

.dark .card-gradient-border {
    background: var(--color-bg-secondary);
}

.dark img {
    opacity: 0.9;
}

/* Flowbite overrides for dark mode */
.dark [data-popper-reference-hidden] {
    background: var(--color-bg-secondary) !important;
}
