/* ============================================
   Smart Finance Tools - Main Stylesheet
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #059669;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --radius: 12px;
    --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span { font-size: 1.5rem; }

nav { display: flex; gap: 4px; }

nav a {
    text-decoration: none;
    color: var(--text-light);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Language Switcher */
nav a.lang-switch {
    margin-left: 8px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 12px;
}

nav a.lang-switch:hover {
    background: var(--primary);
    color: #fff;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* Main */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 200px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 50px 20px 40px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tool-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.tool-card .icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Calculator Page */
.calc-page {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.calc-main { min-width: 0; }

.calc-content {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.calc-content h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.calc-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text);
}

.calc-content p {
    color: var(--text-light);
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.calc-content ul, .calc-content ol {
    margin: 0 0 14px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.calc-content li { margin-bottom: 6px; }

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn:hover { background: var(--primary-dark); }

/* Results */
.result-box {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.result-box.show { display: block; }

.result-box h3 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(37,99,235,0.15);
    font-size: 0.95rem;
}

.result-row:last-child { border-bottom: none; }

.result-row .label { color: var(--text-light); }
.result-row .value { font-weight: 700; color: var(--text); }

.result-row.total .value {
    font-size: 1.2rem;
    color: var(--primary-dark);
}

/* Ad placeholders */
.ad-placeholder {
    background: var(--bg-white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Footer */
footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 30px 20px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links { display: flex; gap: 20px; }

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover { color: var(--primary); }

footer .copyright {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Static pages */
.static-page {
    max-width: 800px;
    margin: 0 auto;
}

.static-page h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.static-page h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 24px 0 10px;
}

.static-page p {
    color: var(--text-light);
    margin-bottom: 14px;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 900px) {
    .calc-page {
        grid-template-columns: 1fr;
    }
    .sidebar { order: -1; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    nav { display: none; }
    nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        padding: 10px 20px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .hamburger { display: block; }
    .footer-inner { flex-direction: column; text-align: center; }
}
