: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-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #000;
    text-align: center;
}

h2 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
    color: #ff6b6b;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #000;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

.main-content {
   
}

/* Calculator Container */
.calculator-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.calculator-section {
    margin-bottom: 2rem;
}

.calculator-section h2 {
    border-bottom: 2px solid var(--teal);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: #ff6b6b;
}

.input-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .input-group {
    flex: 1 1 200px;
    margin-bottom: 0;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    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;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: none;
}

.results-section h2 {
    color: #ff6b6b;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.result-item {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.result-item h3 {
    color: #000;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
    margin-top: 0.5rem;
}

/* Ad Containers */
.ad-container {
    background-color: #f0f0f0;
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-style: italic;
}

#ad-left, #ad-right {
    display: none;
}

#ad-tablet {
    display: none;
}

#ad-mobile {
    display: block;
    width: 100%;
    height: 100px;
}

/* Related Tools */
#related-tools { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); 
    margin-bottom: 1.5rem;
}

#related-tools h2 {
    color: #ff6b6b;
}

.tools-list { 
    list-style: none; 
}

.tools-list li { 
    padding: 10px 0; 
    border-bottom: 1px solid var(--border-color); 
}

.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); 
}

/* Advanced Options */
.advanced-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.advanced-options h3 {
    color: #000;
}

.toggle-advanced {
    background: none;
    border: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-family: 'Times New Roman', Times, serif;
}

/* Charts Section */
.charts-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: none;
}

.charts-section h2 {
    color: #ff6b6b;
}

.charts-section h3 {
    color: #000;
}

.chart-container {
    height: 300px;
    background: white;
    border-radius: 4px;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

/* Reports Section */
.reports-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: none;
}

.reports-section h2 {
    color: #ff6b6b;
}

.reports-section h3 {
    color: #000;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
}

.export-btn:hover {
    background: var(--accent);
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--teal);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Layout (≤767px) */
@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    #ad-mobile {
        display: block;
    }
    #ad-tablet, #ad-left, #ad-right {
        display: none;
    }
    
    .related-tools-mobile {
        display: block;
    }
    .related-tools-desktop {
        display: none;
    }
    
    /* Ensure related tools are below ads on mobile */
    .calculator-main > #related-tools.related-tools-mobile {
        order: 2;
    }
    #ad-mobile {
        order: 1;
    }
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    #ad-tablet {
        display: block;
        width: 300px;
        height: 250px;
        margin: 0 auto;
        margin-top: 10px;
        order: 1;
    }
    
    #ad-mobile, #ad-left, #ad-right {
        display: none;
    }
    
    .btn-group {
        justify-content: center;
    }
    
    button {
        max-width: 200px;
    }
    
    .related-tools-mobile {
        display: block;
        order: 2;
    }
    .related-tools-desktop {
        display: none;
    }
    
    /* Ensure proper ordering for tablet */
    .calculator-main {
        display: flex;
        flex-direction: column;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    .main-content {
        display: grid;
        grid-template-columns: 300px 1fr 300px;
        gap: 1.5rem;
        align-items: start;
    }
    
    #ad-left, #ad-right {
        display: block;
    }
    
    #ad-left {
        width: 300px;
        height: 250px;
    }
    
    #ad-right {
        width: 300px;
        height: 600px;
    }
    
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    .calculator-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .calculator-section {
        margin-bottom: 0;
    }
    
    .results-section {
        grid-column: 1 / -1;
    }
    
    .related-tools-mobile {
        display: none;
    }
    .related-tools-desktop {
        display: block;
        margin-top: 20px;
    }
    
    .sidebar-left {
        position: sticky;
        top: 20px;
        height: fit-content;
        align-self: start;
    }
    
    .sidebar-right {
        position: sticky;
        top: 20px;
        height: fit-content;
        align-self: start;
    }
}

/* 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;
    color: #000;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    font-size: 1rem;
}

.mobile-table td {
    font-size: 1rem;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}