/* Custom styles for HAFSAH TRAVELS prototype */
:root{
	--primary:#4f46e5; /* indigo-600 */
	--muted:#6b7280; /* gray-500 */
}
html,body{height:100%;}
body { font-family: 'Poppins', Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; background-color:#f8fafc; }
.container { max-width: 1100px; }

/* Buttons */
.btn { 
    display: inline-flex; 
    align-items: center; 
    gap: .75rem; 
    padding: .75rem 1.5rem; 
    border-radius: .75rem; 
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-primary { 
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px -3px rgba(79,70,229,0.2);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(79,70,229,0.3);
}

.btn-primary:hover::after {
    opacity: 1;
}
.btn-ghost { 
    border: 2px solid rgba(79,70,229,0.15); 
    color: var(--primary); 
    background: transparent;
}
.btn-ghost:hover {
    background: rgba(79,70,229,0.05);
    border-color: rgba(79,70,229,0.25);
    transform: translateY(-2px);
}

/* Cards */
.card { background:white; border-radius:.6rem; box-shadow:0 6px 18px rgba(15,23,42,.06); padding:1.25rem; }

/* Hero Section Styles */
.hero-title {
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Gradient Animations */
.animate-gradient {
    background-size: 200% auto;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Blob Animation */
.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* Feature Card Styles */
.feature-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(79,70,229,0.1);
}

/* Compact Layout Helpers */
.compact-layout {
    --space-y: 1rem;
    --content-max-w: 85vh;
}

@media (min-height: 800px) {
    .compact-layout {
        --space-y: 1.5rem;
    }
}

/* Hero animations and effects */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Ensure content fits in viewport */
.fit-viewport {
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
}

/* Responsive scaling */
@media (max-height: 700px) {
    .hero-title {
        font-size: calc(1.5rem + 2vmin) !important;
    }
    .compact-text {
        font-size: 0.875rem !important;
    }
    .compact-spacing {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* Hero Feature Icons */
.hero-feature-icon {
    transition: all 0.3s ease;
}

.group:hover .hero-feature-icon {
    transform: scale(1.1);
    color: var(--primary);
}

/* Enhanced gradient animations */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced blob animations */
.animate-blob {
    animation: blob 10s infinite cubic-bezier(0.4, 0, 0.2, 1);
    filter: blur(40px);
}

@keyframes blob {
    0%, 100% {
        transform: translate(0px, 0px) scale(1);
    }
    25% {
        transform: translate(40px, -30px) scale(1.2);
    }
    50% {
        transform: translate(-20px, 40px) scale(0.9);
    }
    75% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* Stats Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

/* Hero Button Animations */
.btn svg {
    transition: transform 0.2s ease;
}

.btn:hover svg {
    transform: translateX(4px);
}

/* Footer */
.site-footer{background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);} 
.footer-link{color:var(--muted); text-decoration:none}
.footer-link:hover{color:var(--primary)}

/* Images */
img { display:block; max-width:100%; height:auto; }

/* Image Loading States */
.img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.img-loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.img-error {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.img-error svg {
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

/* Image Fade In Animation */
.fade-in {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.fade-in.loaded {
    opacity: 1;
}

/* Retry Button Styles */
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dc2626;
    color: #dc2626;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #dc2626;
    color: white;
}

/* Category Labels */
.category-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    z-index: 10;
}

/* Small helpers */
.muted{color:var(--muted)}
.accent{color:var(--primary)}

/* Responsive tweaks */
@media (min-width:1024px){
	.container{max-width:1200px}
}

/* Subtle animations */
.fade-up{opacity:0; transform:translateY(10px); transition:opacity .6s ease, transform .6s ease;}
.fade-up.in-view{opacity:1; transform:none}

/* Card hover */
.card{transition:transform .25s ease, box-shadow .25s ease}
.card:hover{transform:translateY(-6px); box-shadow:0 12px 30px rgba(15,23,42,.09)}

/* Mobile nav */
#mobile-menu {
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 40;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#mobile-menu a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

#mobile-menu a:hover, #mobile-menu a:focus {
    color: var(--primary);
    background-color: rgba(79,70,229,0.05);
}

/* Mobile optimization */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Improve touch targets */
    button, 
    .btn,
    a.btn,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }

    /* Adjust font sizes for mobile */
    .text-3xl {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .text-2xl {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* Adjust spacing */
    .py-12 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .py-8 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* Fix mobile height issues */
    .min-h-screen {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

/* Buttons subtle */
.btn{transition:transform .15s ease, box-shadow .15s ease}
.btn:active{transform:translateY(1px)}

/* Hero section image styling */
@media (min-width:1024px){
	.hero-image{border-radius:.8rem}
}

/* Image grid animations and effects */
.transform {
    transition: transform 0.3s ease-in-out;
}

.shadow-lg {
    transition: box-shadow 0.3s ease-in-out;
}

/* Hover effects for image cards */
.bg-white.p-2:hover {
    transform: scale(1.02) rotate(0deg) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Ensure images load smoothly */
img {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Optional: Fade in effect for specific images */
img[data-fade] {
    opacity: 0;
}

img[data-fade].loaded {
    opacity: 1;
}

/* Image Loading States */
.img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.img-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.img-error {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    text-align: center;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.fade-in {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.fade-in.loaded {
    opacity: 1;
}

/* Enhanced Mobile Optimizations */
/* Safe area insets for modern iOS devices */
:root {
    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);
}

/* Better mobile performance */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-overflow-scrolling: touch;
}

/* Prevent scroll chain and improve momentum scrolling */
body {
    overscroll-behavior-y: contain;
    position: fixed;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

html {
    overflow: hidden;
    height: 100%;
}

@supports (-webkit-touch-callout: none) {
    /* iOS-specific styles */
    body {
        cursor: pointer;
    }
    
    /* Disable elastic scrolling on iOS */
    body {
        position: fixed;
        width: 100%;
    }
}

/* Mobile-first responsive design */
@media (max-width: 640px) {
    /* Improve spacing with safe areas */
    .container {
        padding-left: calc(1rem + var(--sal, 0px)) !important;
        padding-right: calc(1rem + var(--sar, 0px)) !important;
        padding-bottom: calc(1rem + var(--sab, 0px)) !important;
    }

    /* Better grid layouts on mobile */
    .grid {
        gap: 1rem !important;
    }

    /* Adjust card padding and touch targets */
    .card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }

    /* Improve text readability */
    body {
        font-size: 16px;
        line-height: 1.5;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Fix header for iOS notch */
    header {
        padding-top: calc(env(safe-area-inset-top) + 0.5rem) !important;
    }

    /* Enhance touch targets */
    .btn,
    button,
    [role="button"],
    input,
    select,
    a {
        touch-action: manipulation;
    }

    /* Fix mobile viewport height */
    .min-h-screen {
        min-height: calc(var(--vh, 1vh) * 100);
    }

    /* Improve form elements */
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Better spacing for stacked elements */
    .space-y-1 > * + * {
        margin-top: 0.25rem;
    }

    .space-y-2 > * + * {
        margin-top: 0.5rem;
    }

    .space-y-4 > * + * {
        margin-top: 1rem;
    }
}

/* Improve mobile scroll performance */
* {
    -webkit-overflow-scrolling: touch;
}

/* Prevent content shift on mobile */
html {
    overflow-x: hidden;
    width: 100vw;
}

/* Better mobile tap highlights */
a, button {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Enhanced mobile animations */
@media (prefers-reduced-motion: no-preference) {
    .animate-fade-in {
        animation-duration: 0.3s;
    }
}

/* Mobile menu backdrop */
#mobile-menu {
    background-color: rgba(255, 255, 255, 0.98);
}

/* Active state for mobile buttons */
.btn:active,
button:active {
    transform: scale(0.98);
}

/* Responsive images with better loading */
img {
    height: auto;
    max-width: 100%;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* Enhanced touch interactions */
.btn,
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Prevent text selection during taps */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Better form elements for mobile */
input,
select,
textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    font-size: 16px !important;
    padding: 12px !important;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Fix for iOS form zoom */
@supports (-webkit-touch-callout: none) {
    input, 
    select, 
    textarea {
        font-size: 16px !important;
    }
}

/* Mobile-friendly buttons */
.btn {
    min-height: 44px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 12px;
    transition: transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

/* Active states for touch devices */
@media (hover: none) {
    .btn:active,
    button:active {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }
}

/* Fix for iOS momentum scrolling */
.scroll-container {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

/* Fix sticky hover states on mobile */
@media (hover: hover) {
    .btn:hover {
        opacity: 0.9;
    }
}

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior-y: contain;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mobile menu improvements */
#mobile-menu {
    position: fixed;
    top: calc(80px + env(safe-area-inset-top));
    height: calc(100vh - 80px - env(safe-area-inset-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Bottom safe area padding for iOS */
.footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom)) !important;
}

/* Fix for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .has-safe-area {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Fix for mobile browsers address bar */
.min-h-screen {
    min-height: -webkit-fill-available;
}

@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}
