/* MLS9 Version: 0.3.19 - style.css */
:root {
    --primary: #006AFF;
    --primary-dark: #0056cf;
    --primary-soft: #e6f2ff;
    --text-main: #2a2a33;
    --text-muted: #596b82;
    --bg-body: #f9f9fb;
    --bg-card: #ffffff;
    --border: #dce0e6;
    --success: #00a862;
    --warning: #ffaa00;
    --danger: #d93c3c;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* HEADER */
header { background: #fff; border-bottom: 1px solid var(--border); padding: 15px 0; position: sticky; top: 0; z-index: 50; }
.logo-link { display: block; flex: 0 0 auto; }
.logo-img { height: 40px; width: auto; display: block; }
.nav-links a { margin-left: 20px; font-weight: 500; color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); padding: 6px 12px; border-radius: 20px; }

/* SEARCH BAR CONTAINER (2/3 Width) */
.search-bar-header { 
    flex: 0 0 66%; 
    max-width: 66%; 
    margin: 0 auto; /* Centered */
}

/* SEARCH FORM FLEX */
.search-form {
    display: flex;
    width: 100%;
    gap: 0;
}

/* SEARCH INPUT */
.search-input { 
    flex: 1; 
    padding: 10px 15px; 
    border: 1px solid var(--border); 
    border-right: none; 
    border-radius: 4px 0 0 4px; 
    font-size: 1rem; 
}
.search-input:focus { border-color: var(--primary); outline: none; background: #f0f7ff; }

/* SEARCH BUTTON (15% Width) */
.header-search-btn { 
    width: 15%; 
    min-width: 50px;
    padding: 0 !important;
    font-size: 1rem; 
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* USER MENU */
.header-right { flex: 0 0 auto; display: flex; align-items: center; }
.user-menu-container { position: relative; margin-left: 20px; }
.user-avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; overflow: hidden; transition: border-color 0.2s; }
.user-avatar-btn:hover { border-color: var(--primary); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.dropdown-menu { display: none; position: absolute; right: 0; top: 50px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); width: 240px; z-index: 100; overflow: hidden; }
.dropdown-menu.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: var(--text-main); font-size: 0.9rem; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item i { width: 25px; text-align: center; color: var(--text-muted); }
.user-email-display { display: block; padding: 12px 15px; border-bottom: 1px solid #f0f0f0; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; background: #f9f9fb; }

/* CARDS */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.card-img { height: 180px; background: #eee; position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 15px; }
.card-price { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }
.card-meta { font-size: 0.9rem; color: var(--text-muted); margin: 5px 0; }
.badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.7); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge.closing { background: var(--primary); }

/* BUTTONS */
.btn { display: inline-block; padding: 10px 20px; border-radius: 4px; font-weight: 600; text-align: center; cursor: pointer; border: none; font-size: 0.9rem; width: 100%; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border: 1px solid var(--border); background: #fff; color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* TABS */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; background: #fff; padding: 0 20px; }
.tab-btn { padding: 15px 20px; cursor: pointer; color: var(--text-muted); font-weight: 600; border-bottom: 3px solid transparent; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* AUTH PAGES */
.auth-container { max-width: 400px; margin: 80px auto; }
.auth-card { padding: 40px; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 10px; color: var(--primary-dark); }
.auth-card p.subtitle { color: var(--text-muted); margin-bottom: 30px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.form-group input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.form-group input:focus { border-color: var(--primary); outline: none; background: var(--primary-soft); }
.auth-switch { margin-top: 20px; font-size: 0.9rem; color: var(--text-muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.alert { padding: 12px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; text-align: left; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* DEALCHECK GRIDS */
.dc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 20px; margin-bottom: 20px; }
.dc-card { background: #fff; border: 1px solid #e0e6ef; border-radius: 8px; padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.dc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.dc-header h4 { margin: 0; color: var(--primary-dark); font-size: 1rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }

/* TABLES (Left Aligned) */
.dc-table { width: 100%; font-size: 0.9rem; border-collapse: collapse; }
.dc-table th { text-align: left !important; padding: 10px; background: #f9f9fb; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border); }
.dc-table td { padding: 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; text-align: left !important; }
.dc-table tr:last-child td { border-bottom: none; }
.history-container { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; }
.history-container table { margin: 0; width: 100%; }
.history-container th { position: sticky; top: 0; background: #f9f9fb; z-index: 10; text-align: left; }

/* INPUTS */
.dc-input { width: 90px; padding: 5px; border: 1px solid #dce0e6; border-radius: 4px; text-align: right; font-family: inherit; color: var(--text-main); font-weight: 500; transition: border 0.2s; }
.dc-input:focus { border-color: var(--primary); outline: none; background: #f0f7ff; }
.val-pos { color: var(--success); font-weight: 600; }
.val-neg { color: var(--danger); font-weight: 600; }
.total-row td { font-weight: 800; border-top: 2px solid #e0e6ef; padding-top: 12px; font-size: 1rem; }

/* VISUALS */
.chart-wrapper { position: relative; height: 180px; width: 100%; display: flex; justify-content: center; }
.strat-nav { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.strat-btn { padding: 8px 16px; border: 1px solid #ddd; background: #fff; border-radius: 20px; cursor: pointer; font-size: 0.9rem; color: #666; }
.strat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* STATS ROW */
.stats-row { display: flex; gap: 40px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border); overflow-x: auto; }
.stat-item { display: flex; flex-direction: column; padding-right: 40px; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-val { font-size: 1.4rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.stat-lbl { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-top: 5px; }
.stat-highlight { color: var(--primary); }

/* OVERVIEW LAYOUT */
.overview-top-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .overview-top-grid { grid-template-columns: 1fr; } }
.map-card { position: relative; height: 100%; min-height: 350px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map-overlay-data { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.95); padding: 15px; backdrop-filter: blur(4px); border-top: 1px solid rgba(0,0,0,0.1); font-size: 0.85rem; color: var(--text-main); }
.data-group-title { font-size: 0.75rem; color: var(--primary); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; border-bottom: 2px solid var(--primary-soft); padding-bottom: 4px; margin-top: 20px; }
.data-group-title:first-child { margin-top: 0; }
.data-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f9f9fb; font-size: 0.9rem; }
.data-row:last-child { border-bottom: none; }
.data-row span:first-child { color: var(--text-muted); }
.data-row span:last-child { font-weight: 500; color: var(--text-main); text-align: right; }

/* --- VALUATION SLIDERS --- */
.val-slider-container { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.val-slider { flex: 1; -webkit-appearance: none; height: 4px; background: #e0e6ef; border-radius: 2px; outline: none; }
.val-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--primary); border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.1s; }
.val-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.btn-reset-small { background: #f0f2f5; border: 1px solid #dce0e6; color: var(--text-muted); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; cursor: pointer; transition: all 0.2s; }
.btn-reset-small:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }

/* MLS9 Version: 0.3.19 - style.css */
/* ... (Previous styles preserved) ... */

/* --- VALUATION SLIDERS & INPUTS --- */
.val-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.val-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #dce0e6;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    -moz-appearance: textfield; /* Remove spinner arrows */
}
.val-input::-webkit-outer-spin-button,
.val-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.val-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: #e0e6ef;
    border-radius: 2px;
    outline: none;
}

.val-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}

.val-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.btn-reset-small {
    background: #f0f2f5;
    border: 1px solid #dce0e6;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-reset-small:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft);
}