:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f8f9fa;
    --card-color: #ffffff;
    --border-color: #e6e6e6;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

header h1 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

section {
    margin-bottom: 3rem;
    background-color: var(--card-color);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 500;
    width: 100%;
    margin-top: 1rem;
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-small {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px;
}

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

.bonus-section h3 {
    display: flex;
    align-items: center;
}

.bonus-container {
    position: relative;
    width: 100%;
}

.bonus-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 12px;
    background-color: #f5f7ff;
    border-radius: 5px;
}

.bonus-amount {
    flex: 1.5;
    min-width: 160px;
}

.bonus-type, .bonus-period {
    flex: 1;
    min-width: 140px;
}

.bonus-start-date {
    flex: 1.5;
    min-width: 160px;
}

.bonus-amount, .bonus-period, .bonus-type, .bonus-start-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bonus-item input,
.bonus-item select {
    padding: 6px 8px;
    height: 35px;
    margin: 0;
    width: 100%;
}

.bonus-pensionable {
    margin-top: 24px;
    margin-left: 12px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 35px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
}

.remove-bonus {
    margin-top: 24px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure small text doesn't affect alignment */
.form-text {
    font-size: 0.75rem;
    margin-top: 2px;
    color: var(--text-light);
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.income-periods-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pension-breakdown-card .tax-breakdown-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tax-breakdown-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.25rem;
    font-weight: 500;
}

.tax-breakdown-card h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

.tax-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.tax-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tax-bands-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tax-band-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Remove the last margin-bottom from the last grid in the card */
.tax-breakdown-card > div:last-child {
    margin-bottom: 0;
}

.tax-breakdown-label {
    color: #666;
}

.tax-breakdown-value {
    font-weight: 600;
    color: #333;
}

/* Add color coding for specific values */
.personal-allowance-item .tax-breakdown-value {
    color: #4CAF50; /* Green for positive values */
}

.personal-allowance-item .tax-breakdown-value:contains("-") {
    color: #F44336; /* Red for negative values */
}

.pension-allowance-item .tax-breakdown-value {
    color: #2196F3; /* Blue for pension-related values */
}

.summary-card h3, .pension-breakdown-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #212529;
    font-size: 1.25rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.summary-item:last-child {
    margin-bottom: 0;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #212529;
    font-size: 1.25rem;
}

.chart-wrapper {
    height: 300px;
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

/* Force single column on smaller screens */
@media (max-width: 1400px) {
    .recommendations-container {
        grid-template-columns: 1fr;
    }
}

/* Ensure cards have equal height */
.recommendation-card {
    height: 100%;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation-card:hover {
    transform: translateY(-5px);
}

.recommendation-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.recommendation-card h3 {
    margin: 0;
}

.recommendation-card p {
    margin: 0;
}

.recommendation-detail {
    padding: 10px;
    background-color: #f5f7ff;
    border-radius: 5px;
    font-size: 0.9rem;
}

footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
}

footer p {
    margin-bottom: 1rem;
}

footer small {
    opacity: 0.8;
}

.remove-bonus:hover {
    background-color: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.remove-bonus i {
    line-height: 1;
}

@media (min-width: 768px) {
    .results-container {
        grid-template-columns: 1fr 2fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-primary {
        width: auto;
    }
}

.pension-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.pension-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.pension-section .form-group {
    margin-bottom: 1rem;
}

.pension-section .form-group:last-child {
    margin-bottom: 0;
}

.slider-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-container input[type="range"] {
    flex: 1;
    margin-right: 10px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 4px;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.slider-container span {
    min-width: 50px;
    text-align: right;
    font-weight: 500;
}

.pension-examples {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pension-example {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.example-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.example-details {
    font-size: 0.9rem;
}

.example-total {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.example-savings {
    margin-top: 0.5rem;
    color: var(--success-color);
    font-weight: 500;
}

.btn-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: color 0.3s;
}

.btn-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.btn-link i {
    margin-left: 5px;
    font-size: 0.8rem;
}

.tax-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tax-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tax-breakdown-label {
    font-weight: 500;
    color: #495057;
}

.tax-breakdown-value {
    font-weight: 600;
    color: #212529;
}

#tax-breakdown h3 {
    margin-bottom: 1rem;
    color: #212529;
    font-size: 1.25rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: #e9ecef;
}

.radio-label input[type="radio"] {
    margin: 0;
    width: auto;
}

.income-period-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.income-period-section h5 {
    margin: 0 0 1rem 0;
    color: #212529;
    font-size: 1rem;
}

.income-period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.income-period-item:last-child {
    border-bottom: none;
}

.income-period-label {
    color: #495057;
}

.income-period-value {
    font-weight: 500;
    color: #212529;
}

.bonus-period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.bonus-period-item:last-child {
    border-bottom: none;
}

.bonus-period-label {
    color: #495057;
}

.bonus-period-value {
    font-weight: 500;
    color: #212529;
}

#tax-breakdown h4 {
    margin: 2rem 0 1rem 0;
    color: #212529;
    font-size: 1.1rem;
}

.pension-breakdown-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.pension-breakdown-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.pension-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pension-chart-container {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    height: 300px;
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .income-periods-grid {
        margin-top: 1.5rem;
    }
    
    .pension-breakdown-content {
        grid-template-columns: 1fr;
    }
    
    .pension-chart-container {
        height: 250px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* Income Periods Table */
.income-table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.income-periods-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: white;
}

.income-periods-table th,
.income-periods-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid #eaeaea;
}

.income-periods-table th:first-child,
.income-periods-table td:first-child {
    text-align: left;
    font-weight: 500;
    background-color: #f5f7ff;
    color: var(--primary-color);
}

.income-periods-table th {
    background-color: #f1f3f9;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.income-periods-table tr:last-child td {
    border-bottom: none;
}

.income-periods-table tr:hover td {
    background-color: #f8f9ff;
}

.income-periods-table .take-home-row {
    font-weight: 600;
}

.income-periods-table .take-home-row td {
    color: var(--success-color);
    border-top: 2px solid #eaeaea;
}

.income-periods-table tr:nth-child(5) {
    font-weight: normal;
    color: inherit;
}

.income-periods-table tr:nth-child(5) td {
    border-top: none;
}

@media (max-width: 768px) {
    .income-periods-table {
        font-size: 0.85rem;
    }
    
    .income-periods-table th,
    .income-periods-table td {
        padding: 0.6rem 0.75rem;
    }
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.summary-card h4 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
}

.bonus-periods-table {
    margin-top: 0.75rem;
    width: 100%;
}

.bonus-periods-table th,
.bonus-periods-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eaeaea;
}

.bonus-periods-table th:first-child,
.bonus-periods-table td:first-child {
    text-align: left;
    font-weight: 500;
    background-color: #f5f7ff;
    color: var(--primary-color);
}

.bonus-periods-table th {
    background-color: #f1f3f9;
    font-weight: 600;
}

.bonus-periods-table tr:last-child td {
    border-bottom: none;
}

.bonus-periods-table tr:hover td {
    background-color: #f8f9ff;
}

.personal-allowance-item {
    background-color: #f5f9ff;
}

.personal-allowance-item:nth-child(2) .tax-breakdown-value {
    color: var(--error-color);
}

.pension-allowance-item {
    background-color: #f0f7ff;
}

.pension-allowance-item:nth-child(3) .tax-breakdown-value {
    color: var(--success-color);
}

.bonus-row td {
    background-color: #f0f7ff;
    color: var(--primary-color);
}

.bonus-period-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-left: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Style the bonus-pensionable div */
.bonus-pensionable {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.bonus-period-row td {
    background-color: #e8f0ff;
    color: var(--primary-color);
    font-style: italic;
    font-size: 0.9rem;
}

.bonus-period-row td:first-child {
    padding-left: 2rem;
}

.bonus-period-row td:last-child {
    font-weight: 600;
    color: var(--success-color);
}

.tax-breakdown-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tax-breakdown-section .tax-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: none;
}

.tax-breakdown-section .tax-breakdown-label {
    font-weight: 500;
    color: #495057;
}

.tax-breakdown-section .tax-breakdown-value {
    font-weight: 600;
    color: #212529;
}

/* Override the grid layout for the initial tax breakdown */
.tax-breakdown-section {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.form-select:hover {
    border-color: var(--primary-color);
}

.top-form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.top-form-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .top-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .top-form-row .form-group {
        margin-bottom: 1rem;
    }
}

/* Update pension section layout */
.pension-section .radio-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.pension-section .radio-options .form-group {
    margin-bottom: 0;
}

/* Ensure radio options stack on mobile */
@media (max-width: 768px) {
    .pension-section .radio-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pension-section .radio-options .form-group {
        margin-bottom: 1rem;
    }
}

.cgt-example {
    background-color: var(--background-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.cgt-example p {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.cgt-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.cgt-grid span:nth-child(odd) {
    color: var(--text-light);
}

.cgt-grid span:nth-child(even) {
    font-weight: 500;
    color: var(--text-color);
}

/* Remove the old styles */
.tax-example-list {
    display: none;
}

.recommendation-detail p {
    margin: 0.75rem 0;
    line-height: 1.4;
}

.recommendation-detail p:first-child {
    margin-top: 0;
}

.recommendation-detail p:last-child {
    margin-bottom: 0;
}

.recommendation-detail small {
    color: var(--text-light);
    display: block;
    margin-top: 0.5rem;
}

.stub-period-label {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.next-payment-label {
    color: #666;
    font-size: 0.9em;
}

.bonus-next-payment-row {
    background-color: #f9f9f9;
}

.bonus-next-payment-row td {
    padding: 0.5rem 1rem;
    border-top: none;
}

/* Adjust input padding for more compact look */
.bonus-item input,
.bonus-item select {
    padding: 8px 12px;
} 