/* 
   Calorie Calculator - Yesterbite 
   Mobile First Design
   Theme: Fresh Food/Fitness
*/

:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --accent-color: #FF9800;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --font-heading: system-ui, -apple-system, sans-serif;
    --font-body: system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #A94438;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    /* Adjust based on actual logo aspect ratio */
    width: auto;
    max-width: 200px;
    object-fit: contain;
    background: #fff;
    padding: 2px 4px;
    border-radius: 4px;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
}

.nav-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 40px 0 20px;
}

.hero-section h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.subtitle {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-section {
    padding: 20px 0;
}

.calculator-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Radio Buttons (Gender) */
.radio-options {
    display: flex;
    gap: 16px;
}

.radio-label {
    position: relative;
    cursor: pointer;
    flex: 1;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-label input:checked+.radio-custom {
    background: #e8f5e9;
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

/* Inputs */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 100px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--white);
    appearance: none;
    /* simple removal of default arrow in some browsers */
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.unit {
    position: absolute;
    right: 12px;
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Button */
.btn-calculate {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-calculate:hover {
    background-color: var(--primary-dark);
}

/* Results */
.hidden {
    display: none;
}

.results-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.results-container h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.calories-result {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.kcal-label {
    display: block;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.goal-description {
    margin: 10px 0 30px;
    color: var(--text-light);
    font-style: italic;
}

/* Macros */
.macros-container h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.macro-item {
    background: #f9f9f9;
    padding: 15px 10px;
    border-radius: 8px;
}

.macro-val {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.macro-name {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.macro-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.macro-bar div {
    height: 100%;
    border-radius: 2px;
}

.protein .macro-bar div {
    background: #E57373;
}

.carbs .macro-bar div {
    background: #81C784;
}

.fats .macro-bar div {
    background: #FFB74D;
}

.macro-note {
    font-size: 0.8rem;
    color: #999;
}

/* Content */
.content-section {
    padding: 40px 0;
    background: var(--white);
    margin-top: 40px;
}

.content-section h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: var(--text-color);
}

.content-section p,
.content-section li {
    margin-bottom: 15px;
}

.content-section ol {
    /* ensure list items are visible */
    padding-left: 20px;
    margin-bottom: 20px;
}


/* Medical Disclaimer */
.medical-disclaimer {
    background: #FFF3E0;
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 30px 0;
}

.medical-disclaimer h3 {
    color: #E65100;
    font-size: 1.1rem;
    margin: 0 0 10px;
}

.medical-disclaimer p {
    font-size: 0.95rem;
    margin: 0;
    color: #5D4037;
}

/* FAQ */
.faq-container {
    margin-top: 20px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
    list-style: none;
    /* Hide default arrow */
    position: relative;
    padding-right: 20px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-item p {
    margin-top: 10px;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background: #2d3436;
    color: #dfe6e9;
    padding: 40px 0;
    margin-top: auto;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #dfe6e9;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.copyright {
    color: #b2bec3;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: #636e72;
    max-width: 600px;
    margin: 0 auto;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .gender-group {
        margin-bottom: 20px;
    }

    .form-row {
        gap: 12px;
    }

    .calories-result {
        font-size: 3rem;
    }

    .macro-grid {
        gap: 8px;
    }

    .macro-val {
        font-size: 1rem;
    }
}