/* ==========================================================================
   Room Dekho – custom styles (Tailwind handles layout & utilities)
   ========================================================================== */

:root {
    --brand: #e11d48;
    --brand-500: #f43f5e;
    --brand-soft: #fff1f3;
}

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-family: 'DM Sans', 'Noto Sans', system-ui, sans-serif; }
h1, h2, h3, .font-display { letter-spacing: -0.02em; }
img { max-width: 100%; }

.pb-safe { padding-bottom: env(safe-area-inset-bottom); }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.line-clamp-1, .line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.animate-fadeUp { animation: fadeUp .35s ease both; }

/* ---------- Hero backgrounds ---------- */
.hero-bg {
    position: relative;
    background:
        radial-gradient(900px 380px at 100% 0%, rgba(244, 63, 94, .14), transparent 60%),
        radial-gradient(700px 320px at 0% 100%, rgba(251, 146, 60, .12), transparent 60%),
        linear-gradient(180deg, #fff 0%, #fff6f7 100%);
    isolation: isolate;
}
.hero-bg::before {
    /* subtle dot pattern on every page hero */
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(15, 23, 42, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
}

/* Home hero: animated gradient mesh */
.hero-home { background: linear-gradient(160deg, #fff 0%, #fff5f6 45%, #fff8f1 100%); }
.hero-blob { position: absolute; border-radius: 999px; filter: blur(60px); opacity: .55; z-index: -1; animation: blob 18s ease-in-out infinite; }
.hero-blob-1 { width: 520px; height: 520px; right: -120px; top: -160px; background: #fda4b4; }
.hero-blob-2 { width: 420px; height: 420px; left: -140px; bottom: -160px; background: #fed7aa; animation-delay: -6s; }
.hero-blob-3 { width: 300px; height: 300px; left: 40%; top: 30%; background: #fbcfe8; opacity: .35; animation-delay: -12s; }
.hero-grid {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(225, 29, 72, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(225, 29, 72, .06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}
@keyframes blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.08); }
    66% { transform: translate(-25px, 20px) scale(.94); }
}

/* Hero illustration */
.float-y { animation: floatY 5s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.hero-ring { animation: spin 60s linear infinite; }
.hero-ring-rev { animation-direction: reverse; animation-duration: 45s; }
@keyframes spin { to { transform: rotate(360deg); } }
.pin-pulse { animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: translateX(-50%) scale(.6); opacity: .9; } 100% { transform: translateX(-50%) scale(2.6); opacity: 0; } }
.win-blink { animation: winBlink 4s ease-in-out infinite; }
@keyframes winBlink { 0%, 100% { fill: #fff; } 50% { fill: #fde68a; } }

@media (prefers-reduced-motion: reduce) {
    .hero-blob, .float-y, .hero-ring, .pin-pulse, .win-blink { animation: none; }
}

/* ---------- Room card ---------- */
.room-card { transition: transform .25s ease, box-shadow .25s ease; }
.room-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 22px 40px -14px rgba(15,23,42,.22); }
.room-card:hover .room-card-img { transform: scale(1.04); }
.room-card-img { transition: transform .5s ease; }

/* ---------- Wishlist button ---------- */
.wishlist-btn {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 38px; height: 38px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.95); color: #0f172a;
    box-shadow: 0 2px 10px rgba(15,23,42,.15);
    border: 0; cursor: pointer; transition: all .2s ease;
}
.wishlist-btn:hover { transform: scale(1.08); color: var(--brand); }
.wishlist-btn-active, .wishlist-btn-active:hover { background: var(--brand); color: #fff; }

/* ---------- Image gallery (detail page) ---------- */
.slider-track { display: flex; transition: transform .35s ease; }
.slider-image { min-width: 100%; object-fit: cover; }

/* ---------- Leaflet ---------- */
.leaflet-container { font-family: 'DM Sans', sans-serif; z-index: 1; }
.leaflet-price-marker, .leaflet-map-marker { background: transparent !important; border: none !important; }
.leaflet-control-zoom { border: 0 !important; border-radius: 12px !important; overflow: hidden; box-shadow: 0 4px 14px rgba(15,23,42,.15) !important; }
.leaflet-control-zoom a { color: #0f172a !important; }
.leaflet-popup-content-wrapper { border-radius: 16px !important; box-shadow: 0 12px 30px rgba(15,23,42,.18) !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; min-width: 220px; }

.custom-marker {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 58px; height: 32px; padding: 0 10px;
    background: #0f172a; color: #fff; border-radius: 999px;
    font-weight: 700; font-size: 12px; white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15,23,42,.3); cursor: pointer; transition: transform .2s ease, background .2s ease;
}
.custom-marker::after {
    content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px;
    background: inherit; transform: translateX(-50%) rotate(45deg);
}
.custom-marker span { position: relative; z-index: 1; }
.custom-marker:hover { transform: scale(1.1); background: var(--brand); }

.leaflet-map-pin { position: relative; width: 32px; height: 44px; }
.leaflet-map-pin span {
    position: absolute; top: 0; left: 0; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand); border: 3px solid #fff; border-radius: 50% 50% 50% 0;
    box-shadow: 0 8px 18px rgba(225,29,72,.35); transform: rotate(-45deg);
}
.leaflet-map-pin i { color: #fff; font-size: 12px; transform: rotate(45deg); }

/* ---------- Toasts ---------- */
#toastContainer {
    position: fixed; top: 16px; right: 16px; z-index: 10000;
    display: flex; flex-direction: column; gap: 10px;
    width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
    --toast-accent: #3b82f6; --toast-soft: #eff6ff;
    position: relative; display: grid; grid-template-columns: 36px minmax(0,1fr) 28px; align-items: center; gap: 12px;
    padding: 12px; border-radius: 16px; background: #fff; border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px rgba(15,23,42,.16); overflow: hidden; pointer-events: auto;
    transform: translateY(-12px); opacity: 0; transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
.toast::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--toast-accent); }
.toast.show { transform: none; opacity: 1; }
.toast.success { --toast-accent: #10b981; --toast-soft: #ecfdf5; }
.toast.error { --toast-accent: #ef4444; --toast-soft: #fef2f2; }
.toast.warning { --toast-accent: #f59e0b; --toast-soft: #fffbeb; }
.toast .icon { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--toast-accent); background: var(--toast-soft); }
.toast .content { color: #334155; font-size: 14px; font-weight: 500; line-height: 1.35; }
.toast .close-btn { width: 28px; height: 28px; border-radius: 999px; border: 0; background: transparent; color: #94a3b8; cursor: pointer; }
.toast .close-btn:hover { background: #f1f5f9; color: #0f172a; }
@media (max-width: 640px) { #toastContainer { left: 16px; right: 16px; width: auto; } }

/* ---------- SweetAlert ---------- */
div:where(.swal2-container) div:where(.swal2-popup) { border-radius: 20px; font-family: 'DM Sans', sans-serif; }
div:where(.swal2-container) h2:where(.swal2-title) { font-size: 20px; }
div:where(.swal2-container) div:where(.swal2-html-container) { font-size: 14px; }

/* ---------- Wizard ---------- */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeUp .3s ease both; }
.field-error { border-color: #ef4444 !important; }

/* ---------- FAQ ---------- */
details.faq summary { list-style: none; cursor: pointer; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq[open] .faq-icon { transform: rotate(45deg); }
.faq-icon { transition: transform .2s ease; }

@media (max-width: 768px) {
    .hero-blob { opacity: .3; filter: blur(70px); }
}

/* ---------- Home hero (design v2) ---------- */
.hero-card { background: linear-gradient(135deg, #ffe4e8 0%, #fff5f6 45%, #fff 100%); }
.hero-card-img {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
@media (min-width: 1024px) { .hero-card { background: none; } }

.hero-tab-input:checked + .hero-tab { color: var(--brand); }
.hero-tab-input:checked + .hero-tab .hero-tab-icon { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -6px rgba(225, 29, 72, .55); }
.hero-tab-input:focus-visible + .hero-tab { outline: 3px solid #fecdd6; }
@media (max-width: 1023px) {
    .hero-tab-input:checked + .hero-tab { background: #fff1f3; }
}
@media (min-width: 1024px) {
    .hero-tab-input:checked + .hero-tab { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -8px rgba(225, 29, 72, .6); }
    .hero-tab-input:checked + .hero-tab .hero-tab-icon { background: transparent; box-shadow: none; }
}

/* Map popup (rich room card) */
.leaflet-container .room-popup a { color: inherit; text-decoration: none; }
.leaflet-container .room-popup .leaflet-popup-content { margin: 0 !important; width: auto !important; }
.leaflet-container .room-popup .leaflet-popup-close-button { background: #fff; border-radius: 999px; width: 26px; height: 26px; top: 8px; right: 8px; line-height: 24px; box-shadow: 0 2px 8px rgba(15,23,42,.2); }

/* Desktop hero artwork (from the design): fade left & top edges into the page */
.hero-art-img {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 19%), linear-gradient(180deg, transparent 0%, #000 7%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0%, #000 19%), linear-gradient(180deg, transparent 0%, #000 7%);
    mask-composite: intersect;
}
.hero-pin { transition: transform .25s ease, box-shadow .25s ease; }
.hero-pin:hover { transform: translateY(-3px); }
/* Right column bleeds to the viewport edge like the design */
@media (min-width: 1024px) {
    .hero-art-bleed { width: calc(100% + max(2rem, (100vw - 95rem) / 2 + 2rem)); }
}
