/* === 1. APP CONTAINER (Fixed) === */
#al-app-container {
    display: flex;
    flex-wrap: wrap;
    /* Force a specific height relative to the viewport */
    height: 80vh; 
    min-height: 600px;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: relative;
    z-index: 5; /* Sit above standard page backgrounds */
    margin-bottom: 0; /* Ensure footer sits below */
}

/* === 2. LEFT SIDE: MAP === */
.al-split-left {
    flex: 65%;
    max-width: 65%;
    height: 100%; /* Fill container */
    position: relative;
    background: #eef2f5;
    overflow: hidden;
    cursor: grab;
    border-right: 1px solid #e5e7eb;
}
.al-split-left:active { cursor: grabbing; }

#panContainer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

.al-map-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensures the whole map fits inside */
    display: block;
}

/* Map Controls */
.al-map-controls {
    position: absolute;
    top: 20px; left: 20px; z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
    background: white; padding: 6px; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.al-ctrl-btn {
    width: 36px; height: 36px;
    border: 1px solid #eee; background: #fff;
    font-size: 1.4rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.al-ctrl-btn:hover { background: #f0fdf4; color: #166534; }

/* PINS */
.plot-pin {
    position: absolute;
    width: 20px; height: 20px;
    background: #27ae60;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%); /* This locks it to the coordinate */
    z-index: 10; cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}
.plot-pin:hover { transform: translate(-50%, -50%) scale(1.4); z-index: 20; }
.plot-pin.sold { background: #c0392b; }

/* === 3. RIGHT SIDE: LIST (Scroll Fix) === */
.al-split-right {
    flex: 35%;
    max-width: 35%;
    height: 100%; /* Fill container */
    display: flex;
    flex-direction: column; /* Stack header and list vertically */
    background: #fff;
    z-index: 20;
    box-shadow: -5px 0 20px rgba(0,0,0,0.05);
}

/* Header stays fixed at top of right column */
.al-list-header {
    flex: 0 0 auto; /* Don't shrink */
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

/* Scrollable List Area */
.al-list-scroll {
    flex: 1 1 auto; /* Grow to fill remaining space */
    overflow-y: auto; /* Scrollbar appears HERE */
    padding: 0;
    background: #f9f9f9;
}

/* List Items */
.al-list-row {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.al-list-row:hover { background: #f0fdf4; border-left: 4px solid #1a4d2e; padding-left: 16px; }

/* Typography & Buttons */
.al-plot-name { font-weight: 700; font-size: 1rem; display: block; }
.al-plot-meta { font-size: 0.85rem; color: #777; }
.al-price-text { color: #1a4d2e; font-weight: 700; }

.al-status-pill {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
    font-weight: 700; text-transform: uppercase;
    background: #e8f5e9; color: #2e7d32;
}
.is-sold .al-status-pill { background: #fee2e2; color: #c62828; }

.al-action-btn {
    padding: 6px 12px;
    background: #1a4d2e; color: #c5a059;
    border: none; border-radius: 4px;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
}
.al-action-btn:disabled { background: #ccc; color: #888; }

/* Responsive Mobile */
@media (max-width: 900px) {
    #al-app-container { height: auto; flex-direction: column; }
    .al-split-left { flex: 100%; max-width: 100%; height: 400px; }
    .al-split-right { flex: 100%; max-width: 100%; height: 600px; }
}