:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Times New Roman', Times, serif;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

/* Typography */
h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
}

h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: #ff6b6b;
    font-family: 'Times New Roman', Times, serif;
}

h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
}

h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
}

p, label, input, select, button, li, a, span {
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

@media (min-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

@media (max-width: 767px) {
    h2 { font-size: 1.125rem; }
    h3 { font-size: 1rem; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    h4 { font-size: 1rem; }
}

/* Main Layout */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
    transition: background-color 0.3s;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.btn-calculate {
    background-color: var(--teal);
    color: white;
}

.btn-reset {
    background-color: var(--secondary);
    color: white;
}

.btn-export {
    background-color: var(--accent);
    color: white;
}

button:hover {
    opacity: 0.9;
}

/* Results Section */
.results {
    margin-top: 2rem;
    display: none;
}

.results.active {
    display: block;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 1rem;
}

.result-item {
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 4px;
    border-left: 4px solid var(--teal);
    color: #000;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-buttons button {
    flex: 1;
    min-width: 120px;
}

/* Amortization Table */
.amortization-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.875rem;
}

.amortization-table th, .amortization-table td {
    padding: 8px 12px;
    text-align: right;
    border: 1px solid var(--border-color);
    color: #000;
}

.amortization-table th {
    background-color: var(--light-bg);
    font-weight: bold;
    font-size: 1rem;
}

.amortization-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.amortization-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.table-controls select {
    width: auto;
    padding: 5px;
}

/* Chart Container */
.chart-container {
    width: 100%;
    height: 300px;
    margin-top: 20px;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--teal);
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    font-size: 1.125rem;
}

/* Print-specific styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .calculator-section, .calculator-section * {
        visibility: visible;
    }
    
    .calculator-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
    
    .btn-group, .export-buttons {
        display: none !important;
    }
    
    .result-grid {
        display: block;
    }
    
    .result-item {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }
    
    .amortization-container {
        max-height: none;
        overflow: visible;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .notification {
        display: none;
    }
}

/* Ad Styles */
.ad-zone {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    border: 1px dashed var(--border-color);
    margin: 0 auto;
    font-family: 'Times New Roman', Times, serif;
}

#ad-left, #ad-right, #ad-tablet, #ad-mobile {
    display: none;
}

/* Updated Related Tools Styles */
#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Mobile Layout (default) */
@media (max-width: 767px) {
    #ad-mobile {
        display: block;
    }
    
    #ad-mobile {
        width: 320px;
        height: 100px;
        margin: 20px auto;
    }
    
    .mobile-related-tools {
        display: block;
    }
    
    .desktop-related-tools {
        display: none;
    }
    
    .amortization-table {
        font-size: 0.75rem;
    }
    
    .amortization-table th, .amortization-table td {
        padding: 5px 8px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #ad-tablet {
        display: block;
        text-align: center;
    }
    
    #ad-tablet {
        width: 300px;
        height: 250px;
        margin: 10px auto 0;
    }
    
    .mobile-related-tools {
        display: block;
    }
    
    .desktop-related-tools {
        display: none;
    }
}

/* Desktop Layout */
@media (min-width: 1025px) {
    .container {
        display: grid;
        grid-template-columns: 300px 1fr 300px;
        gap: 30px;
    }
    
    #ad-left, #ad-right {
        display: block;
    }
    
    .sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
    }
    
    #ad-left {
        width: 300px;
        height: 250px;
        margin-bottom: 30px;
    }
    
    #ad-right {
        width: 300px;
        height: 600px;
    }
    
    .mobile-related-tools {
        display: none;
    }
    
    .desktop-related-tools {
        display: block;
    }
}

/* Responsive Results */
@media (min-width: 768px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 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;
}
