:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --font-family: 'Times New Roman', Times, serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

.calculator-content {
    color: #000;
}

/* Main Layout */
.main-layout {
    display: flex;
    flex-direction: column;
    gap: 0 20px;
}

/* Calculator Styling */
.calculator {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #000;
    margin-bottom: 20px;
    font-size: 1.25rem;
    text-align: center;
}

h2 {
    color: #ff6b6b;
    margin: 15px 0 10px;
    font-size: 1.125rem;
}

h3 {
    color: #000;
    margin: 10px 0;
    font-size: 1rem;
}

h4 {
    color: #000;
    font-size: 0.9375rem;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 1rem;
    color: #000;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #000;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

button {
    background-color: var(--teal);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: bold;
    font-size: 1rem;
    width: 100%;
    position: relative;
}

/* Remove hover effects */
.reset-btn {
    background-color: var(--secondary);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-btn {
    background-color: var(--primary);
    flex: 1;
    min-width: 120px;
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results {
    margin-top: 25px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 8px;
    display: none;
    color: #000;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.result-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.result-card h4 {
    color: #000;
    margin-bottom: 10px;
    font-size: 0.9375rem;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--teal);
}

/* Modern Barometer */
.barometer-container {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.barometer {
    position: relative;
    height: 120px;
    margin: 30px 0;
}

.barometer-scale {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(to right, #4CAF50, #8BC34A, #FFC107, #FF9800, #F44336);
    border-radius: 6px;
    transform: translateY(-50%);
}

.barometer-markers {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 20px;
    transform: translateY(-50%);
}

.barometer-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 20px;
    background: #333;
    transform: translateX(-50%);
}

.barometer-marker-label {
    position: absolute;
    top: 25px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #000;
    white-space: nowrap;
}

.barometer-needle {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 20px solid #2c3e50;
    transform: translate(-50%, -50%);
    transition: left 1s ease-out;
    z-index: 10;
}

.barometer-needle::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -2px;
    width: 4px;
    height: 40px;
    background: #2c3e50;
    z-index: -1;
}

.barometer-value {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.barometer-value::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2c3e50;
}

.barometer-categories {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.barometer-category {
    text-align: center;
    flex: 1;
    color: #000;
}

.category-label {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #000;
}

.category-range {
    font-size: 0.75rem;
    color: #000;
}

/* Chart Container */
.chart-container {
    margin-top: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.chart {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 10px;
    position: relative;
}

.chart-bar {
    width: 40px;
    background-color: var(--teal);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-bar-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: #000;
}

.chart-bar-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #000;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #000;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* Ad Containers */
.ad-container {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    margin: 20px 0;
}

#ad-left, #ad-right {
    display: none;
}

#ad-tablet, #ad-mobile {
    display: none;
}

/* Related Tools */
#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); 
}

.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); 
}

#related-tools-mobile {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.toggle-switch {
    display: flex;
    background-color: #f0f0f0;
    border-radius: 25px;
    padding: 5px;
    width: 200px;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #000;
}

.toggle-option.active {
    background-color: var(--teal);
    color: white;
}

/* Children-specific inputs */
#children-age, #children-method, #children-results {
    display: none;
}

/* Current weight unit toggle */
#current-weight-metric, #current-weight-imperial {
    display: none;
}

#current-weight-metric.active, #current-weight-imperial.active {
    display: block;
}

/* Chart print button */
.chart-print-btn {
    background-color: #ff6b6b;
    margin-top: 10px;
}

/* Mobile Layout (≤767px) */
#ad-mobile {
    display: flex;
    width: 100%;
    height: 100px;
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    h4 {
        font-size: 1rem;
    }

    #ad-tablet {
        display: flex;
        width: 300px;
        height: 250px;
        margin: 20px auto;
    }

    #ad-mobile {
        display: none;
    }

    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .button-group {
        justify-content: center;
    }

    /* Show mobile related tools on tablet */
    #related-tools-mobile {
        display: block;
    }
    #related-tools {
        display: none;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }

    .main-layout {
        flex-direction: row;
        gap: 20px;
    }

    .calculator-area {
        flex: 1;
    }

    .sidebar {
        width: 300px;
    }

    #ad-left, #ad-right {
        display: flex;
        width: 300px;
        margin-bottom: 20px;
        margin-top: 0px;
    }

    #ad-left {
        height: 250px;
    }

    #ad-right {
        height: 600px;
    }

    #ad-tablet, #ad-mobile {
        display: none;
    }

    .sticky-sidebar {
        position: sticky;
        top: 20px;
    }

    /* Hide mobile related tools on desktop */
    #related-tools-mobile {
        display: none;
    }
    
    /* Show desktop related tools on desktop */
    #related-tools {
        display: block;
    }
}

/* Mobile Layout (≤767px) */
@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    h3 {
        font-size: 1rem;
    }

    h4 {
        font-size: 0.9375rem;
    }

    #related-tools-mobile {
        display: block;
    }
    
    #related-tools {
        display: none;
    }
}

/* 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;
    font-size: 1rem;
}

.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;
    font-size: 1rem;
    color: #000;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    color: #000;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}