/* --- Color Palette --- */
:root {
    --bg-color: #F9F7F2;
    --text-color: #1F1F1F;
    --accent-color: #1D3C69;
    --accent-light: #eef2f6;
    --white: #ffffff;
    --border-radius: 12px;
}

/* --- Global Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: #EBEBEB;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-color);
}

/* --- Main Container --- */
.mobile-container {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 420px;

    /* FIX: Allow height to grow */
    min-height: 100vh;
    height: auto;
    overflow-y: auto;

    padding: 50px 25px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
}

/* --- Header --- */
header {
    text-align: center;
    width: 100%;
    margin-bottom: 30px;
}

.logo-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.tagline {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* --- Buttons (Linktree Style) --- */
#home-view,
#listings-view {
    width: 100%;
    animation: fadeEffect 0.3s;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: 0.2s;
    cursor: pointer;
}

.btn i {
    margin-right: 10px;
}

.btn-filled {
    background: var(--accent-color);
    color: #fff;
    border: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 1.5px solid var(--text-color);
}

.btn:active {
    transform: scale(0.98);
}

/* --- Footer Area --- */
.bottom-section {
    margin-top: auto;
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.icon-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.icon-row a {
    color: var(--text-color);
    font-size: 1.4rem;
}

footer {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
}

footer a {
    color: #999;
    text-decoration: none;
}

/* --- LISTINGS VIEW (The New Stuff) --- */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
}

.nav-header h3 {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
}

.property-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

/* Card Styling */
.property-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.property-card.active {
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Card Header */
.property-header {
    display: flex;
    align-items: center; /* Vertically center everything */
    padding: 15px;       /* Reduced padding slightly to save space */
    gap: 15px;           /* Space between Thumb, Text, and Price */
}
/* The Wrapper for the Thumbnail */
.header-thumb {
    flex-shrink: 0; /* Prevents it from getting squished */
    width: 70px;    /* Nice tap-friendly size */
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
    border: 1px solid rgba(0,0,0,0.05);
}

/* The Image itself */
.header-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Forces it to stay square */
    display: block;
}

/* Adjust Text container to take available space */
.header-text {
    flex-grow: 1; /* Pushes the price tag to the right */
    min-width: 0; /* Critical: allows text to truncate if needed */
}

/* Optional: Make title slightly smaller on mobile to fit */
.header-text h3 {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.location {
    font-size: 0.85rem;
    color: #777;
}

.price-tag {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.price-tag span {
    font-size: 0.7rem;
    font-weight: 400;
}

/* Card Details (Expandable) */
.property-details {
    max-height: 0;           /* Height is 0 when closed */
    overflow: hidden;        /* Hide the content that doesn't fit */
    transition: max-height 0.5s ease-out; /* Smooth slide animation */
    padding: 0 15px;         /* Keep padding horizontal, but 0 vertical to hide fully */
    opacity: 0;              /* Fade out effect */
}

/* 3. ENSURE SCROLLING WORKS */
.property-card {
    /* Allow the card itself to grow as much as needed */
    height: auto;
    overflow: hidden; /* Keeps the rounded corners clean */
}

/* 2. OPEN STATE (Huge height to fit Form + Tall Images) */
.property-card.active .property-details {
    /* We use a massive number (4000px) instead of 'none' 
       so the slide animation still works, but it's tall enough 
       that the form will never be cut off.
    */
    max-height: 4000px; 
    opacity: 1;
    padding-bottom: 20px;    /* Restore bottom padding when open */
}

/* Instagram Style Carousel */
.gallery-container {
    position: relative;
    background: #000;
    overflow: hidden;
}

.gallery-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    cursor: grab;
    cursor: -webkit-grab;
}

.gallery-scroll.grabbing {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    scroll-snap-type: none;
    /* Optional: disables snapping while dragging for smoothness */
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome */
}

/* --- style.css --- */

/* The Container for individual images */
.gallery-item {
    min-width: 100%;
    scroll-snap-align: center;
    
    /* Default to portrait initially or a neutral square to prevent collapse */
    aspect-ratio: 3 / 4; 
    
    background-color: #f0f0f0; /* Placeholder gray */
    transition: aspect-ratio 0.3s ease; /* Smooth snap animation */
    position: relative;
    overflow: hidden;
}

/* 1. If JS says it's Landscape */
.gallery-item[data-orientation="landscape"] {
    aspect-ratio: 4 / 3;
}

/* 2. If JS says it's Portrait */
.gallery-item[data-orientation="portrait"] {
    aspect-ratio: 3 / 4;
}

/* The Image Itself */
.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    
    /* Ensure it fills the calculated box */
    object-fit: cover; 
    
    /* Interaction prevention for your drag logic */
    pointer-events: none;
    -webkit-user-drag: none;
    
    /* Animation: Start invisible */
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Class added by JS once loaded */
.gallery-item img.loaded {
    opacity: 1;
}
.swipe-hint {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Description Box */
.desc-box {
    padding: 20px;
}

.desc-box p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.btn-small {
    width: 100%;
    font-size: 0.9rem;
    padding: 14px;
}

/* Card Footer */
.card-footer {
    padding: 10px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.more-info {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 5px;
}

.expand-icon {
    color: #ccc;
    transition: 0.3s;
}

.property-card.active .expand-icon {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.property-card.active .more-info {
    display: none;
}

/* Animations */
@keyframes fadeEffect {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

.specs-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.specs-row span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.specs-row i {
    color: var(--accent-color);
}

/* --- FORM STYLES --- */
.booking-form {
    display: none; /* Hidden by default */
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    animation: fadeIn 0.3s ease;
}

.booking-form.visible {
    display: block;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    background: #fafafa;
    transition: 0.2s;
}

.form-input:focus {
    border-color: var(--accent-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 60, 105, 0.1);
}

/* Success Message Styling */
.form-success {
    display: none;
    text-align: center;
    color: green;
    padding: 20px;
    font-weight: 500;
}

/* Add to style.css */

.form-container {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-intro {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Custom Select Dropdown Styling */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none; /* Hides default ugly arrow */
    -webkit-appearance: none;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    pointer-events: none; /* Lets clicks pass through to the select */
    font-size: 0.8rem;
}

textarea.form-input {
    resize: vertical; /* Allows resizing only vertically */
    min-height: 80px;
}

/* --- LEGAL MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Darkens the background */
    z-index: 2000; /* sits on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Nice blur effect */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh; /* Keeps it inside screen */
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow-y: auto; /* Allows text scrolling */
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
    transition: 0.2s;
}
.close-modal-btn:hover { background: #e0e0e0; color: #000; }

/* Legal Text Formatting */
.legal-text h2 { margin-bottom: 5px; color: var(--accent-color); }
.legal-text .last-updated { font-size: 0.75rem; color: #888; margin-bottom: 20px; font-style: italic; }
.legal-text h3 { font-size: 1rem; margin-top: 20px; margin-bottom: 8px; }
.legal-text p, .legal-text li { font-size: 0.9rem; color: #555; line-height: 1.6; margin-bottom: 10px; }
.legal-text ul { padding-left: 20px; margin-bottom: 10px; }

.share-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 1;
}

.float-wa {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex; /* Center the icon */
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}
.float-wa:hover { transform: scale(1.1); }

/* Toast Notification (Hidden by default) */
.toast-notification {
    visibility: hidden; /* Takes up no click space */
    min-width: 250px;
    background-color: var(--accent-color); /* Matches your Navy Blue */
    color: #fff;
    text-align: center;
    border-radius: 50px; /* Pill shape */
    padding: 16px;
    position: fixed;
    z-index: 3000; /* On top of everything */
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%); /* Center perfectly */
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s; /* Smooth fade & slide */
    
    /* Flexbox to align icon and text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* The "Show" State */
.toast-notification.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* Slides up slightly */
}