:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    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);
    transition: var(--transition);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

.layout-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.main-content {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 25px;
    position: relative;
    margin-bottom: 24px;
}

.sidebar {
    display: none;
}

.ad-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 24px;
}

.ad-label {
    font-size: 0.8rem;
    color: #000;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Times New Roman', Times, serif;
}

.ad-placeholder {

    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-family: 'Times New Roman', Times, serif;
}


.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: #ff6b6b;
    text-decoration: underline;
}

#ad-left, #ad-tablet, #ad-mobile {
    display: none;
}

#related-tools {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    font-family: 'Times New Roman', Times, serif;
}

#related-tools h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.25rem;
    color: #000;
}

.tools-list {
    list-style: none;
}

.tools-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.tools-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tools-list a {
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-family: 'Times New Roman', Times, serif;
}

.tools-list a:hover {
    color: var(--secondary);
}

h1 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Times New Roman', Times, serif;
    justify-content: center;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px 15px;
    background: var(--light-bg);
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.unit-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #000;
    font-weight: bold;
    font-family: 'Times New Roman', Times, serif;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: #000;
    transition: var(--transition);
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.2);
}

.collapse-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 0;
    margin: 10px 0;
    font-family: 'Times New Roman', Times, serif;
}

.advanced-options {
    display: none;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-top: 10px;
}

.advanced-options.show {
    display: block;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-section {
    display: none;
    margin-top: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
}

.bmi-value {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: #000;
    margin: 20px 0;
    font-family: 'Times New Roman', Times, serif;
}

.bmi-category {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Times New Roman', Times, serif;
}

.underweight {
    background: #a3d9ff;
    color: #0066cc;
}

.normal {
    background: #c8e6c9;
    color: #2e7d32;
}

.overweight {
    background: #ffecb3;
    color: #f57f17;
}

.obese {
    background: #ffcdd2;
    color: #c62828;
}

.bmi-scale {
    height: 30px;
    background: linear-gradient(90deg, #a3d9ff, #c8e6c9, #ffecb3, #ffcdd2);
    border-radius: 15px;
    margin: 30px 0;
    position: relative;
}

.bmi-indicator {
    position: absolute;
    top: -10px;
    width: 4px;
    height: 50px;
    background: var(--primary);
}

.interpretation {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Times New Roman', Times, serif;
}

.export-options {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.export-btn {
    flex: 1;
    padding: 10px;
    background: var(--light-bg);
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Times New Roman', Times, serif;
}

.export-btn:hover {
    background: var(--border-color);
}

.chart-container {
    height: 250px;
    margin: 30px 0;
}

.related-tools-mobile {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: #000;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--primary);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-family: 'Times New Roman', Times, serif;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Fixed Print Styles */
@media print {
    body {
        background: white;
        color: black;
        padding: 0;
        margin: 0;
        font-size: 0.75rem;
    }
    
    body * {
        visibility: hidden;
    }
    
    .print-results,
    .print-results *,
    .bmi-chart-container,
    .bmi-chart-container * {
        visibility: visible;
    }
    
    .print-results {
        display: block !important;
        position: static;
        width: 100%;
        padding: 10px;
        background: white;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0;
        height: auto;
        overflow: visible;
        page-break-inside: avoid;
    }
    
    .bmi-chart-container {
        display: block !important;
        position: static;
        width: 100%;
        page-break-inside: avoid;
        margin: 20px 0 !important;
    }
    
    .chart-container {
        height: 300px !important;
    }
    
    .print-results table,
    .print-results tr,
    .print-results th,
    .print-results td {
        display: table !important;
        visibility: visible !important;
    }
    
    .print-results .print-row {
        display: flex !important;
        margin-bottom: 4px !important;
    }
    
    .print-results .section-title {
        font-size: 0.875rem !important;
        font-weight: bold !important;
        margin: 8px 0 5px !important;
        padding-bottom: 3px !important;
        border-bottom: 1px solid #ddd !important;
        display: block !important;
    }
    
    .print-row {
        margin-bottom: 4px !important;
        font-size: 0.6875rem !important;
    }
    
    .print-label {
        width: 120px !important;
        font-weight: bold !important;
        display: inline-block;
    }
    
    /* Hide print chart button in print view */
    .print-chart-btn {
        display: none !important;
    }
    
    /* Ensure only one page */
    .print-results {
        max-height: 95vh;
        overflow: hidden;
    }
    
    /* Remove all heading styles */
    h1, h2, h3, h4 {
        font-size: 1rem !important;
        font-weight: bold !important;
        margin: 0 0 8px !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Replace headings with bold text */
    .result-section strong {
        font-weight: bold !important;
        display: block;
        margin: 10px 0 5px;
    }
}

/* New Styles for Demographics */
.demographics-display {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Times New Roman', Times, serif;
}

.demographics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.demographics-item {
    flex: 1;
    min-width: 120px;
}

.demographics-label {
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
}

/* BMI Chart Styles */
.bmi-chart-container {
    margin: 30px 0;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
}

.bmi-chart-title {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: #000;
    font-weight: bold;
}

.chart-container {
    height: 250px;
    position: relative;
}

.bmi-chart-ranges {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.85rem;
}

.chart-range {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-range-color {
    width: 20px;
    height: 10px;
    border-radius: 3px;
    margin-bottom: 5px;
}

/* Text results for print */
.print-results {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Times New Roman', Times, serif;
}

.section-title {
    font-weight: bold;
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.25rem;
    color: #000;
}

.print-row {
    display: flex;
    margin-bottom: 10px;
}

.print-label {
    font-weight: bold;
    width: 150px;
}

/* Print Chart Button */
.print-chart-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    transition: var(--transition);
    z-index: 10;
}

.print-chart-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* New styles for kids section */
.kids-intro {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    border-left: 4px solid #2196f3;
}

.percentile-explainer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: #fff8e1;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.percentile-explainer i {
    font-size: 1.375rem;
    color: #ff9800;
}

.percentile-chart {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.percentile-range {
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-weight: bold;
}

.underweight-percentile {
    background: #a3d9ff;
    color: #0066cc;
}

.healthy-percentile {
    background: #c8e6c9;
    color: #2e7d32;
}

.overweight-percentile {
    background: #ffecb3;
    color: #f57f17;
}

.obese-percentile {
    background: #ffcdd2;
    color: #c62828;
}

.percentile-value {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: #2196f3;
}

.percentile-category {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 6px;
}

.age-inputs {
    display: flex;
    gap: 15px;
}

.age-inputs .input-group {
    flex: 1;
}

/* New spinner styles */
.spinner-container {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--accent);
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1.125rem;
        color: #000;
    }
    
    h4 {
        font-size: 1rem;
        color: #000;
    }
    
    .form-row {
        flex-wrap: wrap;
    }
    .input-group {
        flex: 0 0 calc(50% - 8px);
    }
    .btn-group {
        justify-content: center;
    }
    .btn {
        flex: 0 0 200px;
    }
    .related-tools-mobile {
        display: block;
    }
    
    .tab-btn {
        font-size: 1rem;
    }
}

@media (min-width: 1025px) {
    .layout-grid {
        grid-template-columns: 300px 1fr 300px;
    }
    .sidebar {
        display: block;
    }
    #ad-left, #ad-right {
        display: block;
    }
    #ad-tablet, #ad-mobile {
        display: none;
    }
    .sidebar-left, .sidebar-right {
        position: sticky;
        top: 24px;
        align-self: start;
    }
    .main-content {
        padding: 30px;
    }
    .related-tools-mobile {
        display: none;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.125rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1rem;
        color: #000;
    }
    
    h4 {
        font-size: 0.9375rem;
        color: #000;
    }
    
    #ad-mobile {
        display: block;
    }
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    .export-options {
        flex-direction: column;
    }
    .related-tools-mobile {
        display: block;
    }
    .print-chart-btn {
        position: relative;
        top: 0;
        right: 0;
        margin: 10px auto;
        display: block;
    }
    .percentile-chart {
        grid-template-columns: repeat(2, 1fr);
    }
    .age-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-btn {
        font-size: 0.875rem;
    }
}

/* Tablet View Adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1.125rem;
        color: #000;
    }
    
    h4 {
        font-size: 1rem;
        color: #000;
    }
    
    .container {
        display: flex;
        flex-direction: column;
    }
    
    #ad-tablet {
        display: block;
        order: 1;
        margin-bottom: 24px;
    }
    
    #ad-mobile {
        display: none;
    }
    
    #related-tools-mobile {
        order: 2;
    }
}

.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;
    font-size: 1rem;
    color: #000;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}