/* Macro Calculator Styles */
/* Theme: Green/Nutrition - fresh, healthy colors */

.macro-calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    line-height: 1.6;
}

.macro-calculator-container * {
    box-sizing: border-box;
}

/* Hero Section */
.calculator-hero {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #4ade80 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
}

.calculator-hero h1 {
    margin: 0 0 10px 0;
    font-size: 2.4em;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    margin-bottom: 20px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-badges .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-icon {
    font-weight: bold;
}

/* Introduction Section */
.intro-section {
    background: #f0fdf4;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #22c55e;
}

.intro-section h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Macro Overview Cards */
.macro-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.macro-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.macro-card:hover {
    transform: translateY(-3px);
}

.macro-card.protein {
    border-top: 4px solid #ef4444;
}

.macro-card.carbs {
    border-top: 4px solid #f59e0b;
}

.macro-card.fat {
    border-top: 4px solid #3b82f6;
}

.macro-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.macro-card h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.macro-card p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #666;
}

.macro-card span {
    font-size: 0.85em;
    color: #888;
}

/* Privacy Notice */
.privacy-notice {
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
}

.privacy-icon {
    font-size: 1.5em;
}

.privacy-notice strong {
    color: #15803d;
    display: block;
}

.privacy-notice p {
    margin: 4px 0 0 0;
    font-size: 0.9em;
    color: #555;
}

/* Form Section */
.calculator-form-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.calculator-form-section h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 10px;
}

.form-instructions {
    color: #666;
    margin-bottom: 25px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.section-note {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.unit-label {
    font-weight: 400;
    color: #666;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #22c55e;
}

/* Height inputs */
.height-inputs {
    display: flex;
    gap: 10px;
}

.height-inputs input {
    flex: 1;
    text-align: center;
}

/* Activity Options */
.activity-options {
    display: grid;
    gap: 10px;
}

.activity-option {
    cursor: pointer;
}

.activity-option input {
    position: absolute;
    opacity: 0;
}

.activity-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-icon {
    font-size: 1.5em;
    width: 40px;
    text-align: center;
}

.activity-box strong {
    display: block;
    color: #333;
}

.activity-box span {
    display: block;
    font-size: 0.85em;
    color: #666;
}

.activity-option input:checked + .activity-box {
    border-color: #22c55e;
    background: #f0fdf4;
}

.activity-option:hover .activity-box {
    border-color: #4ade80;
}

/* Goal Options */
.goal-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.goal-option {
    cursor: pointer;
}

.goal-option input {
    position: absolute;
    opacity: 0;
}

.goal-box {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.goal-box strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.goal-box span {
    font-size: 0.8em;
    color: #666;
}

.goal-box.lose {
    border-left: 4px solid #ef4444;
}

.goal-box.maintain {
    border-left: 4px solid #22c55e;
}

.goal-box.gain {
    border-left: 4px solid #3b82f6;
}

.goal-option input:checked + .goal-box {
    border-color: #22c55e;
    background: #f0fdf4;
}

.goal-option:hover .goal-box {
    border-color: #4ade80;
}

/* Split Options */
.split-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.split-option {
    cursor: pointer;
}

.split-option input {
    position: absolute;
    opacity: 0;
}

.split-box {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.split-box strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.split-ratio {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 4px;
}

.split-desc {
    font-size: 0.8em;
    color: #666;
}

.split-option input:checked + .split-box {
    border-color: #22c55e;
    background: #f0fdf4;
}

.split-option:hover .split-box {
    border-color: #4ade80;
}

/* Submit Button */
.form-submit {
    margin-top: 30px;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

/* Results Section */
.results-section {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border-top: 4px solid #22c55e;
}

.results-section h2 {
    text-align: center;
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Calorie Display */
.calorie-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 12px;
}

.calorie-box {
    margin-bottom: 20px;
}

.calorie-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.calorie-value {
    font-size: 3.5em;
    font-weight: 700;
    color: #16a34a;
    line-height: 1;
}

.calorie-unit {
    font-size: 1.2em;
    color: #666;
    margin-left: 5px;
}

.calorie-breakdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 15px;
    border-top: 1px solid #bbf7d0;
}

.breakdown-item {
    text-align: center;
}

.breakdown-label {
    display: block;
    font-size: 0.8em;
    color: #666;
}

.breakdown-value {
    font-weight: 600;
    color: #333;
}

/* Macro Results Grid */
.macro-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.macro-result {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.macro-result.protein {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fecaca;
}

.macro-result.carbs {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fde68a;
}

.macro-result.fat {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #bfdbfe;
}

.macro-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.macro-emoji {
    font-size: 1.5em;
}

.macro-header h4 {
    margin: 0;
    color: #333;
}

.macro-value {
    margin-bottom: 8px;
}

.macro-value .grams {
    font-size: 2.5em;
    font-weight: 700;
}

.macro-result.protein .grams {
    color: #dc2626;
}

.macro-result.carbs .grams {
    color: #d97706;
}

.macro-result.fat .grams {
    color: #2563eb;
}

.macro-value .unit {
    font-size: 1em;
    color: #666;
}

.macro-calories {
    font-size: 0.9em;
    color: #666;
}

.macro-percent {
    font-weight: 600;
}

.macro-tip {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    font-size: 0.85em;
}

.tip-label {
    color: #888;
}

.tip-value {
    font-weight: 600;
    color: #333;
}

/* Macro Chart */
.macro-chart {
    margin: 25px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.macro-chart h4 {
    margin: 0 0 15px 0;
    color: #333;
    text-align: center;
}

.macro-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.bar-protein {
    background: linear-gradient(135deg, #ef4444, #f87171);
    transition: width 0.5s ease;
}

.bar-carbs {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    transition: width 0.5s ease;
}

.bar-fat {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    transition: width 0.5s ease;
}

.bar-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.9em;
}

.bar-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-protein .legend-dot {
    background: #ef4444;
}

.legend-carbs .legend-dot {
    background: #f59e0b;
}

.legend-fat .legend-dot {
    background: #3b82f6;
}

/* Food Examples */
.food-examples {
    margin: 25px 0;
}

.food-examples h4 {
    color: #333;
    margin-bottom: 15px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.example-category {
    padding: 15px;
    border-radius: 8px;
}

.example-category.protein {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.example-category.carbs {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.example-category.fat {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.example-category h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.example-category ul {
    margin: 0;
    padding-left: 18px;
}

.example-category li {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
}

/* Tips Section */
.tips-section {
    margin: 25px 0;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.tips-section h4 {
    margin-top: 0;
    color: #16a34a;
}

.tips-section ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.tips-section li {
    margin-bottom: 8px;
}

/* Recalculate Section */
.recalculate-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.recalculate-btn {
    background: white;
    color: #16a34a;
    border: 2px solid #16a34a;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recalculate-btn:hover {
    background: #16a34a;
    color: white;
}

/* Education Section */
.education-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.education-section > h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Tabs */
.education-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #f3f4f6;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #e5e7eb;
}

.tab-btn.active {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: #16a34a;
    margin-top: 0;
}

.tab-content h4 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 10px;
}

.tab-content h5 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 10px;
}

.tab-content ul, .tab-content ol {
    margin: 10px 0 15px 0;
    padding-left: 25px;
}

.tab-content li {
    margin-bottom: 8px;
}

/* Food Lists */
.food-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

.food-category {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
}

.food-category h5 {
    margin-top: 0;
    margin-bottom: 10px;
}

.food-category ul {
    margin: 0;
    padding-left: 18px;
}

.food-category li {
    margin-bottom: 5px;
    font-size: 0.95em;
}

/* Portion Guide */
.portion-guide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.portion-item {
    background: #f0fdf4;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.95em;
}

/* FAQ Section */
.faq-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.faq-section h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 20px;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #16a34a;
}

.faq-icon {
    font-size: 1.5em;
    color: #16a34a;
    font-weight: 300;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 0 20px 0;
    color: #555;
}

.faq-answer p {
    margin: 0;
}

/* Related Calculators */
.related-calculators {
    background: #f0fdf4;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.related-calculators h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.related-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.related-name {
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 5px;
}

.related-desc {
    font-size: 0.85em;
    color: #666;
}

/* Sources Section */
.sources-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.sources-section h2 {
    color: #16a34a;
    margin-top: 0;
    margin-bottom: 20px;
}

.sources-list ul {
    margin: 0;
    padding-left: 20px;
}

.sources-list li {
    margin-bottom: 10px;
    color: #555;
    font-size: 0.95em;
}

.sources-list a {
    color: #16a34a;
    text-decoration: none;
}

.sources-list a:hover {
    text-decoration: underline;
}

/* Disclaimer Section */
.disclaimer-section {
    background: #fef3c7;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.disclaimer-section h3 {
    color: #92400e;
    margin-top: 0;
    margin-bottom: 15px;
}

.disclaimer-section p {
    margin: 0 0 10px 0;
    color: #78350f;
    font-size: 0.95em;
}

.disclaimer-section p:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .macro-calculator-container {
        padding: 15px;
    }

    .calculator-hero {
        padding: 30px 20px;
    }

    .calculator-hero h1 {
        font-size: 1.8em;
    }

    .macro-overview {
        grid-template-columns: 1fr;
    }

    .intro-section,
    .calculator-form-section,
    .results-section,
    .education-section,
    .faq-section,
    .related-calculators,
    .sources-section,
    .disclaimer-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .goal-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .split-options {
        grid-template-columns: 1fr 1fr;
    }

    .macro-results-grid {
        grid-template-columns: 1fr;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .calorie-breakdown {
        flex-direction: column;
        gap: 10px;
    }

    .education-tabs {
        justify-content: center;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 0.85em;
    }

    .food-list {
        grid-template-columns: 1fr;
    }

    .portion-guide {
        grid-template-columns: 1fr;
    }

    .bar-legend {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .calculator-hero h1 {
        font-size: 1.5em;
    }

    .hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .goal-options {
        grid-template-columns: 1fr;
    }

    .split-options {
        grid-template-columns: 1fr;
    }

    .activity-box {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .calorie-value {
        font-size: 2.8em;
    }

    .submit-btn {
        width: 100%;
        padding: 14px 20px;
    }
}
