/* ============================================
   NiceHomes Nepal - Custom CSS
   Design System inspired by Homely
   ============================================ */

/* ============================================
   BASE STYLES
   ============================================ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   PROPERTY CARDS
   ============================================ */

.property-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.property-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .property-card-image img {
    transform: scale(1.05);
}

/* 3D Tour Badge */
.tour-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #334155;
}

.tour-badge i {
    color: #000058;
}

/* Favorite Heart Button */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background: white;
}

.favorite-btn i {
    color: #94a3b8;
    font-size: 16px;
    transition: color 0.2s ease;
}

.favorite-btn.active i,
.favorite-btn:hover i {
    color: #ef4444;
}

.favorite-btn.active i {
    font-weight: 900;
}

/* ============================================
   SEARCH WIDGET
   ============================================ */

.search-widget {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    overflow: visible;
}

.search-widget-panel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-widget-mobile-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 4px;
    color: inherit;
}

.search-widget-mobile-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #94a3b8;
    font-size: 18px;
}

.search-widget-mobile-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-widget-mobile-input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0 6px 0 8px;
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 600;
    color: #334155;
    outline: none;
}

.search-widget-mobile-input::placeholder {
    color: #475569;
    opacity: 1;
}

.search-widget-mobile-submit {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 88, 0.08);
    color: #000058;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-widget-mobile-submit:hover {
    background: rgba(0, 0, 88, 0.14);
}

.search-widget-field {
    flex: 1;
    padding: 0;
    border-radius: 999px;
    transition: background 0.2s ease, transform 0.2s ease;
    min-width: 0;
}

.search-widget-field:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.search-widget-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 12px;
}

.search-widget-field-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 88, 0.08);
    color: #000058;
    font-size: 13px;
}

.search-widget-input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 500;
    color: #0f172a;
    outline: none;
}

.search-widget-input::placeholder {
    color: #64748b;
    opacity: 1;
}

.search-widget-field-chevron {
    color: #94a3b8;
    font-size: 11px;
    flex-shrink: 0;
}

.search-widget-divider {
    width: 1px;
    height: 28px;
    background: rgba(148, 163, 184, 0.24);
    align-self: center;
}

.search-widget-btn {
    background: #000058;
    color: white;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 8.25rem;
    margin-right: 0;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.search-widget-btn:hover {
    background: #01016c;
    transform: translateY(-1px);
}

.search-widget-dropdown {
    width: min(100%, 26rem);
    max-width: min(calc(100vw - 2rem), 26rem);
}

/* ============================================
   MAP MARKERS
   ============================================ */

.map-marker {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #000058;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: 2px solid #fff;
    font-size: 14px;
}

.map-marker:hover {
    background: #00004d;
    transform: scale(1.06);
}

.types-scroll {
    scrollbar-width: none;
}

.types-scroll::-webkit-scrollbar {
    display: none;
}

@media (max-width: 640px) {
    .search-widget {
        border-radius: 1.4rem;
        padding: 9px 10px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
    }

    .search-widget-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .search-widget-expanded .search-widget-panel {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .search-widget-mobile-eyebrow {
        display: none;
    }

    .search-widget-mobile-summary {
        font-size: 0.84rem;
        line-height: 1.1;
    }

    .search-widget-mobile-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .search-widget-mobile-row {
        gap: 6px;
    }

    .search-widget-mobile-input {
        font-size: 0.88rem;
        padding-left: 4px;
    }

    .search-widget-mobile-submit {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .search-widget-field {
        width: 100%;
        border-radius: 1.05rem;
        background: #fff;
        border: 1px solid rgba(148, 163, 184, 0.16);
    }

    .search-widget-field + .search-widget-field {
        margin-top: 6px;
    }

    .search-widget-input-shell {
        padding: 11px 12px;
    }

    .search-widget-input {
        font-size: 15px;
    }

    .search-widget-field-chevron {
        font-size: 11px;
    }

    .search-widget-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
        margin-top: 2px;
        padding: 9px 12px;
        gap: 6px;
        font-size: 12px;
        min-width: 0;
    }

    .search-widget-dropdown {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin-top: 8px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-option:hover {
    background: #f8fafc;
}

.dropdown-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dropdown-checkbox.checked {
    background: #000058;
    border-color: #000058;
}

.dropdown-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #000058;
    color: white;
}

.btn-primary:hover {
    background: #00004d;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #334155;
}

.btn-outline:hover {
    border-color: #000058;
    color: #000058;
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--spinner-color, #ffffff);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

.btn-secondary.btn-loading::after,
.btn-outline.btn-loading::after {
    --spinner-color: #000058;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MODALS
   ============================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active+.modal-content,
.modal-content.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

@media (max-width: 640px) {
    .modal-content {
        width: calc(100% - 24px);
        padding: 24px;
        border-radius: 16px;
    }
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #000058;
    box-shadow: 0 0 0 4px rgba(59, 91, 219, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   IMAGE GALLERY
   ============================================ */

.gallery-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.gallery-thumbnail {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

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

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #fee2e2;
    color: #991b1b;
}

.status-rented {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================
   MAP CONTAINER
   ============================================ */

.map-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: #22c55e;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #000058;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-label {
    font-size: 14px;
    font-weight: 600;
    color: #000058;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

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

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, #000058 0%, #00004d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   RICH TEXT (PROPERTY DESCRIPTION)
   ============================================ */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: #111827;
    font-weight: 600;
    line-height: 1.25;
    margin: 1rem 0 0.5rem;
}

.prose p {
    margin: 0 0 0.75rem;
}

.prose ul,
.prose ol {
    margin: 0.5rem 0 1rem 1.25rem;
    padding: 0;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin: 0.35rem 0;
}

/* Fallback if prose class styles are not applied */
.description-panel h1,
.description-panel h2,
.description-panel h3,
.description-panel h4 {
    color: #111827 !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    margin: 1rem 0 0.5rem !important;
}

.description-panel h1 { font-size: 1.5rem !important; }
.description-panel h2 { font-size: 1.25rem !important; }
.description-panel h3 { font-size: 1.1rem !important; }
.description-panel h4 { font-size: 1rem !important; }

.description-panel p {
    margin: 0 0 0.75rem !important;
}

.description-panel ul,
.description-panel ol {
    margin: 0.5rem 0 1rem 1.25rem !important;
    padding: 0 !important;
    list-style-position: outside !important;
}

.description-panel ul { list-style: disc !important; }
.description-panel ol { list-style: decimal !important; }

.description-panel li {
    margin: 0.35rem 0 !important;
    display: list-item !important;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
