/* ═══════════════════════════════════════════════════════
   Homeland Bodrum — Mobile App-Like Enhancements
   Vite gerektirmez, doğrudan public/ altından yüklenir
   ═══════════════════════════════════════════════════════ */

/* ─── Toast Notifications ─── */
.toast {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               toastOut 0.3s ease-in 2.8s forwards;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.toast-success { background: rgba(16, 185, 129, 0.92); }
.toast-error   { background: rgba(239, 68, 68, 0.92); }
.toast-info    { background: rgba(26, 69, 182, 0.92); }
.toast-warning { background: rgba(245, 158, 11, 0.92); }

@keyframes toastIn {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ─── Skeleton Loader Animation ─── */
.skeleton-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(11,18,32,0.06);
}
.skeleton-card .skeleton-img {
    aspect-ratio: 4/3;
    background: linear-gradient(110deg, #f1f5f9 30%, #e2e8f0 50%, #f1f5f9 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-card .skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(110deg, #f1f5f9 30%, #e2e8f0 50%, #f1f5f9 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin: 8px 16px;
}
.skeleton-card .skeleton-line.w60 { width: 60%; }
.skeleton-card .skeleton-line.w40 { width: 40%; }
.skeleton-card .skeleton-line.w80 { width: 80%; }
.skeleton-card .skeleton-line.h6 { height: 18px; margin-top: 16px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Touch Active States ─── */
@media (hover: none) and (pointer: coarse) {
    .card {
        transition: transform 0.15s ease, box-shadow 0.2s ease !important;
        -webkit-tap-highlight-color: transparent;
    }
    .card:active {
        transform: scale(0.97) !important;
        box-shadow: 0 1px 4px rgba(11,18,32,0.08) !important;
    }

    .btn-primary:active {
        transform: scale(0.96) !important;
        opacity: 0.9;
    }
    .btn-secondary:active {
        transform: scale(0.96) !important;
    }
    .btn-ghost:active {
        background: rgba(11,18,32,0.06) !important;
    }

    /* Chip active */
    .chip:active {
        transform: scale(0.94);
    }

    /* Mobile nav links */
    #mobile-menu a:active {
        background: rgba(26, 69, 182, 0.06);
    }
}

/* ─── Enhanced Bottom Sheet ─── */
.bottom-sheet-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease !important;
}
.bottom-sheet {
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1) !important;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
}
.bottom-sheet-handle {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #cbd5e1;
    margin: 12px auto 16px;
    cursor: grab;
}

/* ─── Enhanced Sticky Bottom Bar ─── */
.sticky-bottom-bar {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255,255,255,0.88) !important;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
}
.sticky-bottom-bar.hidden-bar {
    transform: translateY(100%);
}

/* ─── Enhanced Sticky Header ─── */
#main-header {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255,255,255,0.92) !important;
    transition: all 0.3s ease;
}
#main-header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

/* ─── Mobile Menu Slide Animation ─── */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.25s ease;
    opacity: 0;
}
#mobile-menu.mobile-open {
    max-height: 400px;
    opacity: 1;
}

/* ─── Card Entrance Animation ─── */
.card-animate {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.card-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Scroll Snap for Carousels ─── */
.snap-scroll {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.snap-scroll::-webkit-scrollbar { display: none; }
.snap-scroll > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ─── Image Fade In on Load ─── */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img.lazy.loaded, img.lazy[src]:not([src^="data:"]) {
    opacity: 1;
}

/* ─── Pull-to-Refresh Indicator ─── */
.ptr-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: top 0.3s ease;
}
.ptr-indicator.active {
    top: 16px;
}
.ptr-indicator svg {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    color: #1A45B6;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Form Focus Enhancement ─── */
.form-input:focus {
    box-shadow: 0 0 0 4px rgba(26,69,182,0.08);
}
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .card-animate { opacity: 1; transform: none; }
    .page-enter { animation: none; }
}

/* ─── iOS Overscroll Color ─── */
html {
    overscroll-behavior: none;
}
body {
    overscroll-behavior-y: contain;
}

/* ─── Gallery Thumb Strip ─── */
.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
    border: 2px solid transparent;
    scroll-snap-align: start;
    flex-shrink: 0;
}
.gallery-thumbs img.active,
.gallery-thumbs img:hover {
    opacity: 1;
    border-color: #1A45B6;
}

/* ─── Loading Spinner ─── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
.spinner-brand {
    border-color: rgba(26,69,182,0.2);
    border-top-color: #1A45B6;
}

/* ─── Safe Area Padding ─── */
@supports (padding: env(safe-area-inset-bottom)) {
    .sticky-bottom-bar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .bottom-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
