/* --- Global & Root Styles --- */
:root {
    --brand-primary: #007AFF;
    --brand-whatsapp: #25D366;
    --background-primary: #F2F2F7;
    --background-secondary: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #6c6c70;
    --border-color: #E5E5EA;
    --shadow-color: rgba(0, 0, 0, 0.08);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
body { margin: 0; background-color: var(--background-primary); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
#app-container { height: 100vh; display: flex; flex-direction: column; }
.page { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }
.header { background-color: var(--background-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border-color); text-align: center; font-weight: 600; font-size: 17px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: center; }
.header-back-btn { position: absolute; left: 16px; font-size: 24px; color: var(--brand-primary); }
.content { flex-grow: 1; overflow-y: auto; }
.loading-text { text-align: center; padding-top: 40px; color: var(--text-secondary); }

/* --- Login Page --- */
.login-container { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; padding: 24px; box-sizing: border-box; }
.login-title { font-size: 28px; font-weight: 700; margin-bottom: 40px; }
.input-group { width: 100%; margin-bottom: 20px; }
.input-field { width: 100%; padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; font-size: 16px; box-sizing: border-box; }
.btn { width: 90%; padding: 16px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background-color: var(--brand-primary); color: white; }
.btn-secondary { background-color: var(--border-color); color: var(--text-primary); }
.btn-whatsapp { background-color: var(--brand-whatsapp); color: white; margin: 16px 0; }

/* --- Tab Bar --- */
.tab-bar { display: flex; background-color: var(--background-secondary); border-top: 1px solid var(--border-color); padding: 4px 0; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; color: var(--text-secondary); text-decoration: none; gap: 4px; }
.tab-item.active { color: var(--brand-primary); }
.tab-item ion-icon { font-size: 24px; }
.tab-item span { font-size: 10px; font-weight: 500; }

/* --- Property Card --- */
.property-card { background: var(--background-secondary); margin: 8px 16px; border-radius: 16px; box-shadow: 0 4px 16px var(--shadow-color); overflow: hidden; cursor: pointer; }
.card-gallery-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.card-gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 80%; scroll-snap-align: start; position: relative; height: 220px; }
.gallery-item:first-child { margin-left: 16px; }
.gallery-item:last-child { margin-right: 16px; }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.media-icon { position: absolute; top: 8px; right: 8px; background-color: rgba(0,0,0,0.5); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.card-content { padding: 16px; }
.card-title { font-size: 17px; font-weight: 600; margin: 0 0 4px 0; }
.card-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; display: flex; flex-direction: column; }
.society-name { font-style: italic; font-size: 13px; margin-top: 2px; }
.key-info { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.key-info span:not(:empty):not(:last-child)::after { content: '•'; margin-left: 12px; color: var(--border-color); }
.amenities-preview { display: flex; gap: 16px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.amenity-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); }
.amenity-item ion-icon { font-size: 18px; color: var(--text-secondary); }
.amenity-item-more { font-size: 13px; color: var(--brand-primary); font-weight: 500; }
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.price { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.price span { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.specs { display: flex; gap: 16px; font-size: 15px; }
.specs span { display: flex; align-items: center; gap: 4px; }
.specs ion-icon { font-size: 22px; color: var(--text-secondary); }

/* --- Property Detail Page Styles --- */
.detail-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; background-color: #000; }
.detail-gallery::-webkit-scrollbar { display: none; }
.detail-gallery-item { flex: 0 0 100%; scroll-snap-align: center; height: 300px; }
.detail-gallery-item img, .detail-gallery-item video { width: 100%; height: 100%; object-fit: contain; }
.detail-content-wrapper { padding: 16px; }
.detail-title { font-size: 24px; font-weight: 700; margin: 10px 0; }
.detail-address, .detail-location { color: var(--text-secondary); margin-bottom: 20px; }
.detail-pricing { display: flex; justify-content: space-between; align-items: center; background: var(--background-secondary); padding: 16px; border-radius: 12px; margin-bottom: 20px; }
.detail-pricing .rent { font-size: 22px; font-weight: 700; color: var(--brand-primary); }
.detail-pricing .rent span { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.detail-pricing .deposit { font-size: 15px; color: var(--text-secondary); }
.detail-section-header { font-size: 18px; font-weight: 600; margin-top: 24px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 15px; }
.detail-grid div { background-color: var(--background-secondary); padding: 12px; border-radius: 8px; }
.detail-grid strong { color: var(--text-secondary); display: block; font-size: 12px; margin-bottom: 4px; }
.detail-description { font-size: 15px; line-height: 1.6; color: var(--text-primary); }
.detail-amenities-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.agent-card { display: flex; align-items: center; background-color: var(--background-secondary); padding: 16px; border-radius: 12px; margin-top: 16px; }
.agent-photo { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; margin-right: 16px; }
.agent-info { flex-grow: 1; }
.agent-name { font-weight: 600; }
.agent-contact { color: var(--text-secondary); font-size: 14px; }
.btn-call { background-color: var(--brand-primary); color: white; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 22px; }

/* NEW: Collapsible Section Styles */
.collapsible-section { margin-top: 24px; }
.collapsible-trigger {
    width: 100%;
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    color: var(--brand-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.collapsible-content {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background-color: var(--background-secondary);
    border-radius: 8px;
}
.collapsible-content p { margin: 0; }

/* --- Filter Page Styles --- */
#filter-form { padding-bottom: 80px; }
.filter-section { margin-bottom: 24px; padding: 0 16px; }
.filter-section .select-field, .filter-section .input-field { margin-top: 8px; }
.filter-header { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.filter-actions { padding: 16px; background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border-color); position: sticky; bottom: 0; }
.filter-actions .btn { margin-bottom: 10px; }
.select-field { width: 100%; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; font-size: 16px; background-color: white; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%238A8A8E%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: .65em auto; }
.segmented-control { display: flex; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.segmented-button { flex: 1; padding: 12px; text-align: center; background: white; border: none; font-size: 14px; color: var(--text-primary); cursor: pointer; }
.segmented-button.active { background-color: var(--brand-primary); color: white; font-weight: 600; }
.price-range-inputs { display: flex; gap: 10px; }
.amenities-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.amenity-checkbox { display: none; }
.amenity-chip span { display: inline-block; padding: 8px 14px; border-radius: 20px; background-color: #eef0f2; color: var(--text-secondary); font-size: 14px; cursor: pointer; transition: all 0.2s ease; }
.amenity-checkbox:checked + span { background-color: var(--brand-primary); color: #fff; font-weight: 500; }
