/* ============================================
   Base Layout Styles
   ============================================ */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.split-pane {
    height: 100%;
    overflow: hidden;
}

/* Map Pane */
.map-pane {
    position: relative;
}

.map-pane booking-map {
    width: 100%;
    height: 100%;
}

/* Hide map when list is active */
.map-pane booking-map.hidden {
    display: none !important;
}

/* ============================================
   CSS Variables
   ============================================ */

:root {
    /* Primary Colors - Black & White Theme */
    --color-primary: #1f2937;
    --color-primary-hover: #374151;
    --color-primary-light: #f3f4f6;
    --color-primary-dark: #111827;
    --color-primary-shadow: rgba(31, 41, 55, 0.25);

    /* Accent Color - Keep yellow for markers */
    --color-accent: #fac847;
    --color-accent-hover: #e5b63e;
    --color-accent-light: #FCEDCC;

    /* Tertiary Color */
    --color-tertiary: #F5F2EC;

    /* Secondary Color */
    --color-secondary: #39404A;

    /* Text Colors */
    --color-text-primary: #1f2937;
    --color-text-secondary: #161d2a;
    --color-text-tertiary: #9ca3af;

    /* Background Colors */
    --color-bg-white: #fff;
    --color-bg-light: #f9fafb;
    --color-bg-gray: #f3f4f6;
    --color-bg-gray-light: #f8f8f8;
    --color-bg-quantity-active: #f1f3f4;
    --color-bg-tag: #f5f2ec;
    --color-bg-dark: #1f2937;
    --color-bg-dark-hover: #374151;

    /* Border Colors */
    --color-border: #e5e7eb;
    --color-border-light: #d1d5db;
    --color-border-card: #E6E6E6;

    /* Status Colors */
    --color-error: #ef4444;
    --color-warning-light: #ffc107;
    --color-success: #10b981;
    --color-star: #fbbf24;

    /* Overlay & Backdrop */
    --backdrop-light: rgba(255, 255, 255, 0.9);
    --backdrop-dark: rgba(0, 0, 0, 0.6);
    --overlay-black: rgba(0, 0, 0, 0.5);
    --cards-container-gradient: linear-gradient(to top, rgba(31, 41, 55, 0.5) 0%, transparent 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-btn: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.18);
    --shadow-popup: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.1);
    --shadow-panel:
        -1px 3px 7px 0px rgba(117, 117, 117, 0.1),
        -5px 12px 13px 0px rgba(117, 117, 117, 0.09),
        -11px 27px 17px 0px rgba(117, 117, 117, 0.05),
        -20px 48px 21px 0px rgba(117, 117, 117, 0.01),
        -31px 75px 23px 0px rgba(117, 117, 117, 0);

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 50%;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-12: 3rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Animation Durations */
    --duration-fast: 0.15s;
    --duration-normal: 0.2s;
    --duration-slow: 0.3s;

    /* Z-Index Layers */
    --z-dropdown: 10;
    --z-modal: 100;
    --z-overlay: 1000;
    --z-gallery: 100000;
}

* {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* ============================================
   Property List View
   ============================================ */

.property-list-view {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 3.5rem 0 1rem;
    box-sizing: border-box;
    background: var(--color-bg-white, #fff);
}

.property-list-view.active {
    display: block;
}

.property-list-view property-card {
    display: block;
    width: 100%;
}

.property-list-view property-card:last-of-type {
    margin-bottom: 1rem;
}

/* Horizontal card layout for list view */
.property-list-view .property-card {
    flex-direction: row;
    align-items: stretch;
    height: auto;
    min-height: 8.5rem;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid #cccccc;
    overflow: auto;
}

.property-list-view .property-image-carousel {
    width: 11rem;
    min-width: 11rem;
    height: auto;
    min-height: 8.5rem;
    flex-shrink: 0;
    align-self: stretch;
    border-radius: var(--radius-md, 0.5rem) 0 0 var(--radius-md, 0.5rem);
}

.property-list-view .property-image-carousel img {
    height: 100%;
    min-height: 8.5rem;
    border-radius: var(--radius-md, 0.5rem) 0 0 var(--radius-md, 0.5rem);
}

.property-list-view .carousel-dots {
    bottom: 0.5rem;
}

.property-list-view .carousel-dot {
    width: 5px;
    height: 5px;
}

.property-list-view .property-details {
    flex: 1;
    padding: 0.75rem 1rem;
    justify-content: center;
    gap: 0.5rem;
}

.property-list-view .property-name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.property-list-view .property-tags {
    margin-bottom: 0;
    gap: 0.5rem;
}

.property-list-view .property-tag {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm, 0.25rem);
    border: none;
    background: var(--color-bg-tag, #f5f2ec);
}

.property-list-view .property-footer {
    margin-top: 0;
}

.property-list-view .property-price {
    font-size: 1rem;
}



/* ===========================
   Markdown List Styles - Force bullets
   =========================== */
.markdown-content ul,
.message-content .markdown-content ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin: 0.25rem 0 0.4rem !important;
    display: block !important;
}

.markdown-content ol,
.message-content .markdown-content ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin: 0.25rem 0 0.4rem !important;
    display: block !important;
}

.markdown-content li,
.message-content .markdown-content li {
    display: list-item !important;
    margin: 0.15rem 0 !important;
    line-height: 1.55 !important;
}

.markdown-content ul ul {
    list-style-type: circle !important;
}

.markdown-content ul ul ul {
    list-style-type: square !important;
}

.markdown-content ol ol {
    list-style-type: lower-alpha !important;
}

.markdown-content a {
    color: #edb726;
}

/* ===========================
   Markdown Table Styles
   =========================== */
.markdown-content table {
    width: max-content;
    border-collapse: collapse;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    border: 0.0625rem solid #e8e8e8;
    background: #fff;
    overflow: hidden;
    margin: 1rem 0;
}

.markdown-content thead th {
    padding: 0.5rem 2rem;
    text-align: center;
    background: #F6F6FF;
    color: #39404A;
    font-weight: 600;
    font-size: 0.875rem;
    border-left: 0.0625rem solid #EEF0F1;
    white-space: nowrap;
}

.markdown-content thead th:first-child {
    border-left: none;
}

.markdown-content tbody td {
    padding: 0.5rem 2rem;
    text-align: center;
    border-left: 0.0625rem solid #EEF0F1;
    border-bottom: 0.0625rem solid #EEF0F1;
    color: #484F58;
    font-weight: 400;
    white-space: nowrap;
}

.markdown-content tbody td:first-child {
    font-weight: 600;
    color: #111;
    border-left: none;
}

.markdown-content tbody tr:nth-child(even) td {
    background: #F9F9F9CC;
}

.markdown-content tbody tr:last-child td {
    border-bottom: none;
}

.markdown-content tbody tr:hover {
    background: #fafafa;
}

/* Scrollable wrapper for overflow */
.markdown-content .table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 26rem) {
    .markdown-content thead th {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .markdown-content tbody td {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

.chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.chat-separator {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 3.75rem);
    flex: 1;
    overflow: hidden;
    padding: 0;

    .chat-main {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-width: 0;
        width: 100%;
        transition: width 0.3s ease;
    }

    .chat-main.with-map {
        width: 60%;
        padding: 0 1rem
    }

    .right-div {
        width: 40%;
        background: transparent;
        min-width: 0;
        overflow: hidden;
        border-top-left-radius: 0.6325rem;
        border-bottom-left-radius: 0.6325rem;
        animation: slideInRight 0.3s ease;
        box-shadow: var(--shadow-panel);

        booking-map {
            width: 100%;
            height: 100%;
            display: block;
        }

        filter-panel {
            width: 100%;
            height: 100%;
            display: block;
        }
    }

    /* Padding only when NO map */
    &.sep-compact:not(.has-map) {
        @media (min-width: 481px) {
            padding: 0 15rem;
        }
    }

    &.sep-expanded:not(.has-map) {
        @media (min-width: 481px) {
            padding: 0 25rem;
        }
    }

    @media (max-width: 480px) {
        flex-direction: column;
        padding: 0 1rem !important;

        .chat-main,
        .chat-main.with-map {
            width: 100%;
        }

        .map-container {
            width: 100%;
            height: 40vh;
            border-radius: 0;
        }
    }
}

@keyframes slideInRight {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 40%;
        opacity: 1;
    }
}

/* ============================================
   Shared Panel Styles
   Scoped to custom elements to avoid conflicts with components
   that use same class names (e.g., booking-details)
   ============================================ */

/* Panel Container - inside <panel-container> custom element */
panel-container .panel-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--color-bg-white, #fff);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Panel Header - inside <panel-header> custom element */
panel-header .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    gap: var(--space-3, 0.75rem);
    background: var(--color-bg-white, #fff);
}

panel-header .header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    flex: 1;
    min-width: 0;
}

panel-header .back-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast, 0.15s);
    border-radius: var(--radius-md, 0.5rem);
    margin-left: -0.5rem;
    flex-shrink: 0;
}

panel-header .back-btn:hover {
    background: var(--color-bg-gray, #f3f4f6);
}

panel-header .back-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #000000;
}

panel-header .panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

panel-header .header-stats {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    font-size: 0.8125rem;
    color: #000000;
    flex-shrink: 0;
}

panel-header .header-stats span {
    white-space: nowrap;
}

panel-header .stats-divider {
    color: #000000;
    opacity: 0.3;
}

/* Panel Content - inside <panel-content> custom element */
panel-content .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
}

panel-content .panel-content::-webkit-scrollbar {
    width: 0.375rem;
}

panel-content .panel-content::-webkit-scrollbar-track {
    background: transparent;
}

panel-content .panel-content::-webkit-scrollbar-thumb {
    background: var(--color-border-light, #d1d5db);
    border-radius: 3px;
}

@media (max-width: 768px) {
    panel-header .panel-header {
        padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    }

    panel-header .header-stats {
        display: none;
    }
}

/* ============================================
   Shared Overlay Styles
   Used for full-screen overlays with backdrop blur
   ============================================ */

.booking-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-overlay, 1000);
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   Shared Tooltip Styles
   ============================================ */

.floating-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    max-width: 220px;
    padding: var(--space-3, 0.75rem);
    background: var(--color-bg-white, #fff);
    color: var(--color-text-primary, #1f2937);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: var(--radius-md, 0.5rem);
    box-shadow: var(--shadow-lg, 0 0.25rem 1rem rgba(0, 0, 0, 0.12));
    border: 1px solid var(--color-border, #e5e7eb);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast, 0.15s), visibility var(--transition-fast, 0.15s);
    z-index: 9999;
    pointer-events: none;
}

.floating-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-bg-white, #fff);
}

.tooltip-arrow[data-side='top'] {
    border-right: 1px solid var(--color-border, #e5e7eb);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transform: rotate(45deg);
}

.tooltip-arrow[data-side='bottom'] {
    border-left: 1px solid var(--color-border, #e5e7eb);
    border-top: 1px solid var(--color-border, #e5e7eb);
    transform: rotate(45deg);
}

.tooltip-arrow[data-side='right'] {
    border-left: 1px solid var(--color-border, #e5e7eb);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transform: rotate(45deg);
}

.tooltip-arrow[data-side='left'] {
    border-right: 1px solid var(--color-border, #e5e7eb);
    border-top: 1px solid var(--color-border, #e5e7eb);
    transform: rotate(45deg);
}