:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1400px;
    padding: 0 10px;
}

/* Main Layout */
.main-wrapper {
    display: flex;
    gap: 20px;
}

.calculator-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

/* Sidebars */
.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ad-box, .related-tools {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    text-align: center;
}

.ad-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border: 1px dashed var(--border-color);
}

.related-tools {
    border: 1px solid var(--border-color);
}

.related-tools {
    color: #000;
    margin-bottom: 15px;
    text-align: left;
}

.related-tools ul {
    list-style: none;
    text-align: left;
}

.related-tools li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.related-tools a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.related-tools a:hover {
    color: var(--secondary);
}

.related-tools i {
    color: var(--teal);
    font-size: 1.125rem;
}

/* Calculator Components */
.calculator-header {
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.375rem;
    color: #ff6b6b;
    margin: 20px 0 15px;
    padding-bottom: 8px;
}

h3 {
    font-size: 1.25rem;
    color: #000;
    margin: 15px 0 10px;
}

h4 {
    font-size: 1.125rem;
    color: #000;
    margin: 15px 0 10px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

.toggle-group {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.toggle-text {
    margin-left: 10px;
    color: #000;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--teal);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.button-group {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    color: #000;
}

.btn-calculate {
    background-color: var(--teal);
    color: white;
}

.btn-calculate:hover {
    background-color: #3db9b1;
}

.btn-reset {
    background-color: var(--secondary);
    color: white;
}

.btn-reset:hover {
    background-color: #ff5252;
}

/* Results Section */
.results-container {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.dti-result {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    text-align: center;
}

.front-end, .back-end {
    padding: 15px;
    border-radius: 8px;
    width: 45%;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 10px 0;
    color: #000;
}

.gauge {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    border-radius: 10px;
    width: 0;
    transition: width 1s ease-in-out;
}

.gauge-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #000;
}

.benchmark-select {
    margin: 20px 0;
}

.suggestions {
    margin-top: 20px;
}

.suggestions ul {
    padding-left: 20px;
    margin-top: 10px;
}

.suggestions li {
    margin-bottom: 8px;
    color: #000;
}

.output-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.output-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--accent);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.output-btn:hover {
    background-color: #345280;
}

/* Ad Styling */
.ad-label {
    font-size: 0.875rem;
    color: #000;
    margin-bottom: 5px;
}

#ad-mobile, #ad-tablet {
    display: none;
    margin: 10px auto 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    h4 {
        font-size: 0.9375rem;
    }
    
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 3;
        display: none;
    }
    
    #ad-left, #ad-right, #ad-tablet {
        display: none;
    }
    
    #ad-mobile {
        display: block !important;
        margin: 20px auto;
        max-width: 320px;
        height: 100px;
        order: 2;
    }
    
    #related-tools {
        display: none;
    }
    
    #related-tools-mobile {
        display: block !important;
        order: 3;
        margin: 20px auto;
        max-width: 100%;
    }
    
    #related-tools-tablet {
        display: none;
    }
    
    .dti-result {
        flex-direction: column;
        gap: 15px;
    }
    
    .front-end, .back-end {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .output-actions {
        flex-direction: column;
    }
    
    .calculator-container {
        order: 1;
    }
    
    #ad-mobile {
        order: 2;
    }
    
    #related-tools-mobile {
        order: 3;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        order: 3;
        display: none;
    }
    
    .sidebar > div {
        flex: 1;
        max-width: 300px;
    }
    
    #ad-left, #ad-right, #ad-mobile {
        display: none;
    }
    
    #ad-tablet {
        display: block !important;
        margin: 20px auto;
        max-width: 300px;
        height: 250px;
        order: 2;
    }
    
    #related-tools {
        display: none;
    }
    
    #related-tools-tablet {
        display: block !important;
        order: 3;
        margin: 20px auto;
        max-width: 100%;
    }
    
    #related-tools-mobile {
        display: none;
    }
    
    .calculator-container {
        order: 1;
    }
    
    #ad-tablet {
        order: 2;
    }
    
    #related-tools-tablet {
        order: 3;
    }
}

@media (min-width: 1025px) {
    .sidebar {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
    
    #ad-mobile, #ad-tablet, #related-tools-mobile, #related-tools-tablet {
        display: none;
    }
    
    #ad-left, #ad-right, #related-tools {
        display: block;
    }
    
    .sidebar {
        display: flex;
    }
}

/* Print Styles - Only show results */
@media print {
    body * {
        visibility: hidden;
    }
    
    #results-section, #results-section * {
        visibility: visible;
    }
    
    #results-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        background: white;
        padding: 20px;
    }
    
    .output-actions {
        display: none !important;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary);
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Print-specific styles for results */
.print-header {
    display: none;
}

@media print {
    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid var(--primary);
        padding-bottom: 10px;
    }
}

.benchmark-message {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid var(--teal);
}

.benchmark-message.exceeded {
    border-left-color: var(--danger);
    background-color: #fff5f5;
}

.benchmark-message.met {
    border-left-color: var(--success);
    background-color: #f0fff4;
}

.calculation-summary {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
}

.calculation-summary h4 {
    color: #000;
    margin-bottom: 10px;
}

.calculation-summary p {
    margin: 5px 0;
    color: #000;
}

/* Simple text export styles */
.simple-text-export {
    display: none;
    white-space: pre-wrap;
    font-family: monospace;
    line-height: 1.4;
    padding: 20px;
    background: white;
    border: 1px solid #ccc;
    color: #000;
}

@media print {
    .simple-text-export {
        display: block;
    }
    
    #results-section {
        display: none;
    }
}

/* Toggle styles for income and debt sections */
.input-with-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-toggle input {
    flex: 1;
}

.period-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    width: 140px;
}

.period-option {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    background-color: #f5f5f5;
    transition: background-color 0.3s;
    font-size: 0.875rem;
    min-width: 60px;
    color: #000;
}

.period-option.active {
    background-color: var(--teal);
    color: white;
}

.period-option:not(.active):hover {
    background-color: #e0e0e0;
}

/* Add breadcrumb styles */
.breadcrumb {
    padding: 0px 10px;
    color: #000;
    margin-bottom: 5px;
    font-size: 1rem;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}
    .mobile-table {
        overflow-x: auto;
        margin: 20px 0;
        border: 1px solid #eee;
        border-radius: 8px;
    }
    .mobile-table table {
        width: 100%;
        min-width: 600px;
        border-collapse: collapse;
    }
    .mobile-table th, .mobile-table td {
        padding: 12px 15px;
        text-align: left;
        border-bottom: 1px solid #eee;
    }
    .mobile-table th {
        background-color: #4ecdc4;
        font-weight: bold;
    }
    .mobile-table tr:nth-child(even) {
        background-color: #fafafa;
    }