* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tab-button {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #667eea;
}

.tab-button.active {
    background-color: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.problem-container {
    display: none;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

.problem-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.problem-section h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.problem-statement {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.problem-statement h3 {
    color: #495057;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.problem-statement p {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.problem-statement ul {
    list-style: none;
    padding-left: 0;
}

.problem-statement li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: #495057;
}

.problem-statement li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2em;
}

.problem-statement strong {
    color: #667eea;
}

.solution-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 20px;
}

.solution-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.solution-toggle:active {
    transform: translateY(0);
}

.solution-section {
    margin-top: 20px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.solution-section h3 {
    color: #28a745;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.brs-table {
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

thead th {
    padding: 20px;
    font-size: 1.3em;
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid #dee2e6;
}

tbody td {
    padding: 12px 20px;
    font-size: 1.05em;
}

.starting-balance {
    background-color: #e7f3ff;
    font-weight: 600;
}

.starting-balance.overdraft {
    background-color: #ffe7e7;
}

.section-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

.section-header td {
    padding: 15px 20px;
    color: #495057;
}

.subtotal {
    background-color: #e9ecef;
    font-weight: 600;
}

.final-balance {
    font-size: 1.15em;
    font-weight: bold;
}

.final-balance.favorable {
    background-color: #d4edda;
    color: #155724;
}

.final-balance.overdraft {
    background-color: #f8d7da;
    color: #721c24;
}

.amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.calculation-note {
    background-color: #fff3cd;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 5px solid #ffc107;
}

.calculation-note h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.calculation-note p {
    color: #856404;
    font-size: 1.1em;
    margin: 8px 0;
}

.calculation-note .note {
    font-style: italic;
    color: #856404;
    margin-top: 15px;
}

footer {
    background-color: #f8f9fa;
    padding: 30px 40px;
    text-align: center;
    color: #495057;
    border-top: 2px solid #dee2e6;
}

.info-box {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid #667eea;
    text-align: left;
}

.info-box h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.info-box li:last-child {
    border-bottom: none;
}

.info-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 1.3em;
}

.info-box strong {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 25px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .tab-button {
        min-width: 150px;
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .problem-container {
        padding: 20px;
    }

    .problem-section h2 {
        font-size: 1.5em;
    }

    table {
        font-size: 0.9em;
    }

    tbody td {
        padding: 10px 15px;
    }

    .solution-toggle {
        padding: 12px 30px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .tab-button {
        min-width: 100%;
        font-size: 0.85em;
    }

    .problem-section h2 {
        font-size: 1.3em;
    }

    table {
        font-size: 0.85em;
    }

    tbody td {
        padding: 8px 10px;
    }
}