/* Need to clean up */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background: #d9dfe9;
    overflow: hidden;
}

/* FULLSCREEN MAP */
#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.ellensburg-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
}

/* Header Layout */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 24px;
    flex-wrap: nowrap;
    gap: 20px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.header-scale {
    transform: scale(clamp(0.2, 100vw / 700, 1));
    transform-origin: top left;
}

/* App Name Header */
.house-header {
    background: #000;
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    width: max-content;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
}

.house-title {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 2px;
    background: transparent;
}

.big-house {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #790f0f;
    display: inline-block;
}

.house-sub {
    font-size: 1rem;
    font-weight: 400;
    color: #c1d8e3;
    display: inline-block;
    white-space: nowrap;
}

/* Button Base Style */
.ui-button {
    background: #25344F;
    color: #D5BB93;
    border: 1px solid #569fb0;
    padding: 9px 20px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 1;
    white-space: nowrap;
}

.ui-button:hover {
    transform: scale(1.01);
    border-color: #ffd966;
}

.ui-button i {
    font-size: 1.3rem;
}

.ui-button:active {
    transform: scale(0.95);
}

/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.chat-status, .compare-status {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: black;
    padding: 8px 18px;
    border-radius: 30px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.chat-status.active {
    background: #6a7482;
    color: black;
}

/* Chat Window */
.chat-window {
    position: absolute;
    top: 110%;
    left: 0;
    width: 420px;
    height: 500px;
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    font-size: 0.9rem;
    color: #25344F;
}

.user-message {
    background: #247a8a;
    color: white;
    padding: 8px 12px;
    border-radius: 14px;
    max-width: 80%;
    align-self: flex-end;
    margin-bottom: 6px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.ai-message {
    background: #e5e7eb;
    color: #1f2937;
    padding: 8px 12px;
    border-radius: 14px;
    max-width: 80%;
    align-self: flex-start;
    margin-bottom: 6px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.chat-input-area {
    display: flex;
    gap: 8px;
}

#chatInput {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    transition: 0.15s;
}

#chatInput:focus {
    outline: none;
    border-color: #247a8a;
    box-shadow: 0 0 4px rgba(36, 122, 138, 0.4);
}

#sendChatBtn:hover {
    background: #25344F;
}

/* Filter Toggle Button */
.filter-toggle-btn {
    position: relative;
    z-index: 10000;
}

.filter-toggle-btn i {
    color: #D5BB93;
    font-size: 1.2rem;
}

.filter-toggle-btn.active {
    background: #25344F;
    color: white;
}

.filter-toggle-btn.active i {
    color: #D5BB93;
}

/* Filter Panel */
.filter-panel {
    position: absolute;
    top: 90px;
    left: auto;
    width: 380px;
    max-height: 0;
    overflow: hidden;
    background: #eef4f9;
    padding: 0;
    border-radius: 20px;
    transition: max-height 0.35s ease-out, padding 0.25s ease;
    z-index: 9999;
}

.filter-panel.show {
    padding: 24px 28px;
    max-height: 90vh;
    overflow-y: auto;
    border-bottom: 1px solid #b8cfd9;
    transition: max-height 0.45s ease-in, padding 0.3s ease;
}

.filter-content {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: inset 0 1px 6px rgba(0,0,0,0.02), 0 6px 12px -10px rgba(0,0,0,0.1);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 28px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 24px;
}

.filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-header i {
    color: #25344F;
    font-size: 1.2rem;
}

.filter-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0b2b40;
    margin: 0;
}

/* Price Range */
.price-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.price-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.price-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a6a73;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-field input {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: white;
    font-size: 0.95rem;
    color: #1a3b44;
    font-weight: 500;
    transition: 0.15s;
}

.price-field input:focus {
    border-color: #25344F;
    outline: none;
}

/* Room Buttons */
.room-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.room-btn {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a6a73;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.room-btn.active,
.pet-btn.active {
    background: #25344F;
    border-color: #25344F;
    color: #D5BB93;
}

.room-btn:hover {
    border-color: #25344F;
}

/* Pet Policy */
.pet-toggle {
    display: flex;
    gap: 16px;
}

.pet-btn {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a6a73;
    padding: 10px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Lease Options */
.lease-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.lease-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #2d4e5c;
}

.lease-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #25344F;
    cursor: pointer;
}

/* Distance Inputs */
.distance-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.distance-field {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.distance-field label {
    font-weight: 600;
    color: #2d4e5c;
    min-width: 80px;
    font-size: 0.95rem;
}

.time-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-input input {
    width: 70px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.95rem;
    text-align: center;
}

.time-input input:focus {
    border-color: #25344F;
    outline: none;
}

.time-input span {
    color: #4a6a73;
    font-weight: 500;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}

.reset-btn {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a6a73;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.reset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.filter-apply-btn {
    background: #247a8a;
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #7ec8d4;
}

.filter-apply-btn:hover {
    background: #0e5566;
}

.hidden {
    display: none !important;
}

/* Routing Buttons */
.route-control {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.route-btn {
    appearance: none;
    border: none;
    background: white;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #444;
}

.route-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
  color: #333;
}

.route-button-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.route-btn:not(:last-child) {
    border-right: 1px solid #eaeaea;
}

.route-btn:hover {
    background: #f5f7fa;
}

.route-btn.active {
    background: #007bff;
    color: white;
}

/* Responsive */
@media (max-width: 700px) {
    .top-row {
        transform: scale(0.85);
        transform-origin: left center;
    }
    
    .ui-button {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    
    .filter-panel {
        width: 320px;
    }
    
    .filter-panel.show {
        padding: 16px;
        max-height: 1100px;
    }
    
    .filter-content {
        padding: 20px;
    }
    
    .filter-section {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 12px;
    }
    
    .distance-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .room-buttons {
        justify-content: space-between;
    }
    
    .room-btn {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }
    
    .filter-actions {
        flex-direction: column-reverse;
    }
    
    .reset-btn, .filter-apply-btn {
        width: 100%;
        justify-content: center;
    }
}