/* =========================================
   1. GLOBAL VARIABLES & THEME (Modern SaaS)
   ========================================= */
:root {
    /* Brand Colors */
    --primary: #2563eb;       /* Trust Blue */
    --primary-hover: #1d4ed8; /* Darker Blue */
    --secondary: #0f172a;     /* Dark Slate (Headings) */
    --accent: #38bdf8;        /* Light Blue (Icons) */
    
    /* Text Colors */
    --text-main: #334155;     /* Body Text */
    --text-light: #64748b;    /* Subtitles */
    --text-white: #ffffff;

    /* Backgrounds */
    --bg-body: #f8fafc;       /* Lightest Slate */
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    
    /* UI Elements */
    --radius-card: 16px;
    --radius-btn: 50px;       /* Pill Shape */
    --radius-input: 8px;
    
    /* Shadows (Clean & Subtle) */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-light: 1px solid #e2e8f0;
}

/* =========================================
   2. RESET & BASE TYPOGRAPHY
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; text-align: center; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; color: var(--text-light); }
a { text-decoration: none; color: var(--primary); transition: 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Global Section Spacing */
section {
    padding: 60px 0;
}

/* =========================================
   3. HEADER & NAVIGATION (Fixed)
   ========================================= */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav a {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 5px 0;
}

.nav a:hover {
    color: var(--primary);
}

/* =========================================
   4. GLOBAL COMPONENTS
   ========================================= */

/* Buttons */
.btn, .link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn:hover, .link-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    color: white;
}

/* Base Card Style */
.card, .stat-card, .news-card, .link-card, .converter-card, .property-card, .tool-selector-card {
    background: var(--bg-card);
    border: var(--border-light);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover, .stat-card:hover, .property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Inputs */
input[type="text"], input[type="number"], input[type="email"], select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-input);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s;
    background: #fff;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =========================================
   5. STATS GRID
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card { text-align: center; }

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   6. FEATURES & PROPERTY GRIDS
   ========================================= */
/* Replaces old .cards-grid */
.cards-grid, .property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card-icon, .property-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent);
    display: block;
    text-align: center;
}

.card h3, .property-card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-align: center;
}

.card p, .property-card p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
    color: var(--text-light);
}

.card ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-top: 15px;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.card li {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* =========================================
   7. EMI CHART BARS (Legacy Support)
   ========================================= */
.emi-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    margin: 20px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: var(--radius-input);
}

.emi-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emi-bar-container {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    height: 100%;
}

.emi-principal-bar { background: var(--primary); }
.emi-interest-bar { background: #ef4444; }

/* =========================================
   8. FOOTER
   ========================================= */
.footer {
    background: var(--secondary);
    color: #94a3b8;
    padding: 60px 0 20px;
    font-size: 0.9rem;
    margin-top: 60px;
}

.footer h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer ul { list-style: none; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: #94a3b8; }
.footer a:hover { color: white; }

.footer-bottom {
    text-align: center;
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    font-size: 0.85rem;
}

/* =========================================
   9. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
    /* Header Mobile */
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Grid Mobile */
    .stats-grid, .cards-grid, .property-grid {
        grid-template-columns: 1fr;
    }

    /* Typography Mobile */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    section { padding: 40px 0; }
}