/* File: style.css | Version: 0.0 */
: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; }

/* Header */
header { background: #fff; border-bottom: 1px solid var(--border); padding: 15px 0; position: sticky; top: 0; z-index: 50; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.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; }

/* 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; }

/* DealCheck / Calculator Specifics */
.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; }
.dc-table { width: 100%; font-size: 0.9rem; border-collapse: collapse; }
.dc-table td { padding: 8px 0; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.dc-table tr:last-child td { border-bottom: none; }
.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; }
.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); }
.proj-table th { background: #f9f9fb; padding: 10px; font-size: 0.8rem; color: var(--text-muted); border-bottom: 2px solid #e0e6ef; }
.proj-table td { padding: 10px; text-align: center; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }

/* 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); }

/* Tracker */
.progress-container { height: 6px; background: var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.5s; }

/* --- NEW HEADER STYLES (v0.1) --- */

/* Image Logo */
.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

/* User Avatar & Dropdown */
.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; /* Hidden by default */
    position: absolute;
    right: 0;
    top: 50px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 200px;
    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: 20px;
    text-align: center;
    color: var(--text-muted);
}
/* --- AUTH STYLES (Version 0.4) --- */
.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; }

/* --- DROPDOWN FIXES (v0.5) --- */
.dropdown-menu {
    width: 240px; /* Made slightly wider */
    right: 0;
    left: auto;
}

.user-email-display {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    
    /* Text Truncation Magic */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%; 
    background: #f9f9fb;
}

/* Ensure icons align nicely */
.dropdown-item i {
    width: 25px; 
    text-align: center;
}
/* --- OVERVIEW TAB STYLES (v1.0) --- */

/* Data Card Grid System */
.data-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px 24px;
}

.data-point {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.data-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.data-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    word-break: break-word;
}

/* Map Container */
.map-box {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: #e0e0e0; /* Placeholder color */
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.map-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
    backdrop-filter: blur(4px);
}

/* History Tables */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    text-align: left;
    padding: 10px;
    background: #f9f9fb;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.history-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.history-table tr:last-child td {
    border-bottom: none;
}

/* Section Headers */
.card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.card h3 i {
    color: var(--primary);
    opacity: 0.8;
}
/* MAP BLOCK STYLES */
.map-container { position: relative; height: 350px; width: 100%; border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.map-overlay { 
    position: absolute; bottom: 20px; left: 20px; 
    background: rgba(255, 255, 255, 0.95); 
    padding: 15px; border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    max-width: 300px; backdrop-filter: blur(5px); 
    z-index: 10;
}
/* HISTORY TABLES */
.history-scroll { max-height: 300px; overflow-y: auto; }
.history-table th { position: sticky; top: 0; background: #f9f9fb; z-index: 1; }

/* --- OVERVIEW TAB STYLES (v0.22) --- */

/* Grid Layout for Top Section (Map + Key Details) */
.overview-top-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Map is 1/3, Details are 2/3 */
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .overview-top-grid { grid-template-columns: 1fr; }
}

/* Map Container */
.map-card {
    position: relative;
    height: 100%;
    min-height: 300px;
    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.9);
    padding: 15px;
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Detailed Data Blocks */
.data-group-title {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-soft);
    padding-bottom: 5px;
    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 #f5f5f5;
    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; }

/* History Tables */
.history-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.history-container table { margin: 0; }
.history-container th { position: sticky; top: 0; background: #f9f9fb; z-index: 1; }
/* --- OVERVIEW TAB STYLES (v0.22) --- */

/* Top Grid: Map (1/3) + Details (2/3) */
.overview-top-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; 
    gap: 20px;
    margin-bottom: 20px;
}

/* Mobile stack */
@media (max-width: 900px) {
    .overview-top-grid { grid-template-columns: 1fr; }
}

/* Map Container */
.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);
}

/* Sub-headers in Cards */
.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 Rows */
.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; }

/* Scrollable History Tables */
.history-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.history-container table { margin: 0; }
.history-container th { position: sticky; top: 0; background: #f9f9fb; z-index: 10; }