/* Global Styles */
:root {
    --primary-color: #1b5a8c;
    --primary-dark: #134a74;
    --primary-light: #e8f0f8;
    --secondary-color: #2a7a4a;
    --text-color: #1f3a57;
    --text-light: #4a6a8a;
    --background: #f8fafc;
    --white: #ffffff;
    --border-color: #e2ecf5;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-menu li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-menu li a.active {
    background: var(--primary-color);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: 0.2s;
}

/* Main Content */
main {
    min-height: 70vh;
    padding: 30px 0;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 2rem;
    color: var(--primary-dark);
}

.page-header .subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 4px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 0 30px;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .calculator-section {
        grid-template-columns: 1fr;
    }
}

.calculator-form {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 90, 140, 0.1);
}

.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 3px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.95rem;
    margin: 4px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Result Section */
.result-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
}

.result-card h3 {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1rem;
    margin-bottom: 10px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 15px 0;
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
    text-align: left;
    font-size: 0.9rem;
}

.result-details p {
    margin: 4px 0;
}

/* Chart Section */
.chart-section {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 30px 0;
}

.chart-section h3 {
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.chart-container {
    height: 400px;
    position: relative;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background: var(--primary-dark);
    color: white;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.positive {
    color: var(--secondary-color);
}

.negative {
    color: #c0392b;
}

/* Tabs */
.data-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 24px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-color);
}

.tab-btn:hover {
    background: var(--primary-light);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Projection Grid */
.projection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.projection-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
}

.projection-card h4 {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.95rem;
}

.projection-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 12px 0;
}

/* Case Grid */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.case-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
}

.case-card h4 {
    margin-bottom: 8px;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 6px;
}

.footer-section ul li a {
    color: #b0cce0;
    text-decoration: none;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #b0cce0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-card h3 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
}

.sidebar-card ul li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-card ul li:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 15px 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li a {
        display: block;
        padding: 10px 16px;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .projection-grid {
        grid-template-columns: 1fr;
    }
}

/* Add these styles to the existing CSS */

/* Preset Buttons */
.preset-section {
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 24px 0;
}

.preset-section h4 {
    margin-bottom: 14px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-buttons .btn {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.btn-group .btn {
    flex: 1 1 auto;
    min-width: 100px;
}

/* Form enhancements */
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--white);
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 90, 140, 0.1);
}

.form-group input[type="number"]:hover {
    border-color: #b0c8dd;
}

/* Sync indicator */
.sync-hint {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 4px 12px;
    background: var(--primary-light);
    border-radius: 20px;
    margin-top: 6px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .preset-buttons .btn {
        padding: 4px 12px;
        font-size: 0.8rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 101;
    }

    .nav-toggle span {
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Animated hamburger button transform when active */
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu Dropdown */
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: var(--white);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 15px 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 var(--radius) var(--radius);
        gap: 8px;
        z-index: 99;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .form-grid,
    .result-details,
    .feature-grid,
    .projection-grid {
        grid-template-columns: 1fr;
    }
}