:root {
    --primary: #0284C7;
    --primary-hover: #0369A1;
    --secondary: #38BDF8;
    --accent: #E0F2FE;
    --background: #0A1520;
    --surface: #1E293B;
    --surface-glass: rgba(30, 41, 59, 0.7);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border: rgba(255, 255, 255, 0.1);
    --success: #10B981;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Cards & Glassmorphism */
.card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Inputs */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--background);
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-small:hover {
    border-color: var(--primary);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    text-align: center;
    margin-bottom: 0;
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    position: relative;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

canvas {
    max-width: 100%;
    max-height: 320px;
}

/* Repayment Section */
.repayment-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .repayment-grid {
        grid-template-columns: 1fr;
    }
}

.repayment-results {
    display: flex;
    justify-content: space-around;
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.result-item span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-item strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.highlight-green {
    color: var(--success) !important;
}

/* Comparison Section */
.comparison-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.scenario-card {
    background: rgba(15, 23, 42, 0.6);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
}

.scenario-card h4 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.scenario-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.remove-scenario {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.25rem;
    border: none;
    font-size: 1.2rem;
}

.remove-scenario:hover {
    color: #ef4444;
}

/* Table */
.table-section {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: rgba(15, 23, 42, 0.8);
    color: var(--secondary);
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

td {
    color: var(--text-primary);
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.4s ease-out;
}
