: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);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Main Content Layout */
.content-wrapper {
    display: grid;
    gap: 0 20px;
}

/* Calculator Styles */
.calculator {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calculator h1 {
    margin-bottom: 1.5rem;
    color: #000;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

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;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.5rem;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.calculate-btn {
    background-color: var(--teal);
    color: white;
}

.reset-btn {
    background-color: var(--secondary);
    color: white;
}

/* Spinner Animation */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none;
}

.results h3 {
    margin-bottom: 1rem;
    color: #000;
}

.result-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.result-label {
    font-weight: bold;
    color: #000;
    display: inline-block;
    width: 150px;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-btn {
    background-color: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.875rem;
    width: auto;
    flex: 1;
    min-width: 120px;
}

/* Pie Chart Container */
.pie-chart-container {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chart-title {
    text-align: center;
    margin-bottom: 10px;
    color: #000;
    font-weight: bold;
    font-size: 1rem;
}

.chart-container {
    position: relative;
    height: 250px;
    margin: 0 auto;
}

/* Ad and Sidebar Styles */
.ad-container {
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-align: center;
    padding: 10px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
}

#ad-left, #ad-right {
    height: 250px;
}

#ad-right {
    height: 600px;
}

#ad-tablet, #ad-mobile {
    margin-top: 20px;
}

#ad-tablet {
    width: 300px;
    height: 250px;
    margin: 20px auto;
}

#ad-mobile {
    width: 320px;
    height: 100px;
    margin: 20px auto;
}

/* Related Tools Styles */
#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    font-family: 'Times New Roman', Times, serif;
    margin-top: 15px;
}

.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;
    font-size: 1rem;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Responsive Typography */
h1 {
    font-size: 1.25rem;
    color: #000;
}

h2 {
    font-size: 1.125rem;
    color: #ff6b6b;
}

h3 {
    font-size: 1rem;
    color: #000;
}

h4 {
    font-size: 0.9375rem;
    color: #000;
}

/* Mobile Layout (≤767px) */
.sidebar-left, .sidebar-right {
    display: none;
}

#ad-tablet, #ad-left, #ad-right {
    display: none;
}

#ad-mobile {
    display: block;
}

.related-tools.desktop {
    display: none;
}

.related-tools.mobile-tablet {
    display: block;
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.125rem;
    }

    h4 {
        font-size: 1rem;
    }

    #ad-tablet {
        display: block;
    }

    #ad-mobile, #ad-left, #ad-right {
        display: none;
    }

    .related-tools.desktop {
        display: none;
    }

    .related-tools.mobile-tablet {
        display: block;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    .content-wrapper {
        grid-template-columns: 300px 1fr 300px;
    }

    .sidebar-left, .sidebar-right {
        display: block;
    }

    .sidebar-left, .sidebar-right {
        position: sticky;
        top: 20px;
        align-self: start;
    }

    #ad-left, #ad-right {
        display: block;
    }

    #ad-tablet, #ad-mobile {
        display: none;
    }

    .calculator {
        padding: 30px;
    }

    .related-tools.desktop {
        display: block;
    }

    .related-tools.mobile-tablet {
        display: none;
    }

    .button-group {
        flex-direction: row;
    }

    button {
        width: 100%;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.375rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }
}

/* Accessibility Improvements */
button:focus, input:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 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;
    color: #000;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}