/* Compound Interest Calculator Styles */
:root {
    --bg: #070d0a;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.07);
    --text: #f1f5f9;
    --text-muted: #64748b;
    --accent: #10b981;
    --accent2: #f59e0b;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 10% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 90% 90%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
}

.tool-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--accent);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f1f5f9, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Layout */
.tool-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
    align-items: start;
}

.input-panel {
    display: flex;
    flex-direction: column;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-with-unit:focus-within {
    border-color: var(--accent);
}

.unit-prefix,
.unit-suffix {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.unit-suffix {
    border-right: none;
    border-left: 1px solid var(--border);
}

.input-with-unit input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.75rem;
    font-size: 1rem;
    outline: none;
}

.form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select:focus {
    border-color: var(--accent);
}

.calc-btn {
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent), #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px var(--accent-glow);
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.summary-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.summary-card.total {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
}

.summary-card.invested {
    background: var(--surface);
}

.summary-card.interest {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
    border-color: rgba(245, 158, 11, 0.25);
}

.sum-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sum-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.summary-card.total .sum-val {
    color: var(--accent);
}

.summary-card.interest .sum-val {
    color: var(--accent2);
}

/* Chart */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Table */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-title {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table-wrapper {
    max-height: 300px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0.75rem 1rem;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #0d1a12;
}

th:first-child {
    text-align: left;
}

td {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

td:first-child {
    text-align: left;
    color: var(--text-muted);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width:900px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }
}