:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --success: #4CAF50;
    --warning: #FFC107;
    --info: #2196F3;
}

* {
    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: #f5f7fa;
    padding: 0;
}

h1, h2, h3 {
    color: #000;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.25rem;
    color: #000;
}

h2 {
    font-size: 1.125rem;
    color: #ff6b6b;
}

h3 {
    font-size: 1rem;
    color: #000;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.grid-container {
    display: grid;
    gap: 20px;
}

.sidebar {
    display: none;
}

.ad {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 20px;
    overflow: hidden;
}

#ad-mobile {
    width: 320px;
    height: 100px;
    margin: 20px auto;
}

#ad-tablet {
    display: none;
    width: 300px;
    height: 250px;
    margin: 10px auto 20px;
}

.calculator {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    color: #000;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(61, 90, 128, 0.2);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--light-bg);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    color: #000;
}

.radio-option:hover {
    background: #e9ecef;
}

.radio-option.selected {
    background-color: var(--accent);
    color: white;
}

.radio-option.selected input {
    accent-color: white;
}

.units-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    min-width: 120px;
    transition: all 0.3s;
    color: #000;
}

.toggle-btn:hover {
    background: #e9ecef;
}

.toggle-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-calculate {
    background-color: var(--teal);
    color: white;
    flex: 1;
}

.btn-calculate:hover {
    background-color: #3bb4ac;
}

.btn-reset {
    background-color: var(--secondary);
    color: white;
    flex: 1;
}

.btn-reset:hover {
    background-color: #ff5252;
}

.btn-print {
    background-color: var(--primary);
    color: white;
}

.btn-print:hover {
    background-color: #1a252f;
}

.results {
    margin-top: 30px;
    display: none;
}

.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 4px solid var(--teal);
}

.calorie-result {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calorie-result i {
    font-size: 3rem;
}

.energy-toggle {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.energy-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
    color: #000;
}

.energy-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.macronutrients {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.macro-card {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    min-width: 150px;
}

.macro-card.carbs {
    border-top: 4px solid var(--success);
}

.macro-card.protein {
    border-top: 4px solid var(--info);
}

.macro-card.fat {
    border-top: 4px solid var(--warning);
}

.macro-title {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #000;
}

.macro-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    margin: 5px 0;
}

.chart-container {
    height: 300px;
    background-color: white;
    border-radius: 10px;
    margin: 25px 0;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.chart-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-col {
    flex: 1;
    min-width: 300px;
}

.export-options {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.export-btn {
    background-color: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background-color: #1a252f;
}

.ratio-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.ratio-control input {
    width: 80px;
    padding: 8px;
    text-align: center;
}

.ratio-control span {
    font-weight: bold;
    min-width: 80px;
    color: #000;
}

.related-tools {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.tool-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.tool-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tool-list a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tool-list a:hover {
    color: var(--teal);
}

.calculator strong {
    display: block;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

@media (max-width: 1024px) {
    main .related-tools {
        display: block !important;
        margin-top: 20px;
    }
}

#body-fat-group {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateX(200%);
    transition: transform 0.4s ease;
}

.toast.show {
    transform: translateX(0);
}

.height-input-group {
    display: flex;
    gap: 15px;
}

.height-input-group .form-group {
    flex: 1;
    margin-bottom: 0;
}

#height-imperial-group {
    display: none;
}

@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.25rem;
    }
    h3 {
        font-size: 1.125rem;
    }
    
    #ad-mobile {
        display: none;
    }
    
    #ad-tablet {
        display: flex;
    }
    
    .form-row {
        display: flex;
        gap: 20px;
    }
    
    .form-group {
        flex: 1;
    }
}

@media (min-width: 1025px) {
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.375rem;
    }
    h3 {
        font-size: 1.25rem;
    }
    
    .grid-container {
        grid-template-columns: 300px 1fr 300px;
    }
    
    .sidebar {
        display: block;
    }
    
    .left-sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
    }
    
    .right-sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
    }
    
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    #ad-left {
        width: 300px;
        height: 250px;
    }
    
    #ad-right {
        width: 300px;
        height: 600px;
    }
    
    main > .related-tools {
        display: none;
    }
}

.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;
        font-size: 1rem;
        color: #000;
    }
    .mobile-table th {
        background-color: #4ecdc4;
        font-weight: bold;
    }
    .mobile-table tr:nth-child(even) {
        background-color: #fafafa;
    }