:root {
    --primary-color: #2C3E50;
    --secondary-color: #ECF0F1;
    --accent-orange: #F39C12;
    --accent-green: #27AE60;
    --neutral-gray: #BDC3C7;
    --text-dark: #2C3E50;
    --text-light: #ECF0F1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Merriweather', serif;
    color: var(--text-dark);
    background-color: var(--secondary-color);
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-color);
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--neutral-gray);
}

h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

a {
    color: var(--accent-orange);
    text-decoration: none;
    transition: all 0.2s ease-out;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Header */
.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.8rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-orange) !important;
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    margin-left: 1.5rem;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-orange) !important;
}

.navbar-nav .nav-link.active {
    color: var(--accent-orange) !important;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-orange);
}

.dropdown-menu {
    background-color: var(--primary-color) !important;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    color: var(--text-light) !important;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--accent-orange) !important;
    color: white !important;
}

/* Container */
.container, .container-lg {
    max-width: 1440px;
    padding-left: 40px;
    padding-right: 40px;
}

/* Sections */
section {
    padding: 80px 0;
}

section:nth-child(even) {
    background-color: rgba(189, 195, 199, 0.1);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-bottom: 1rem;
}

.section-title p {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(44, 62, 80, 0.9) 100%);
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/hero-macronutrients.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: -1;
}

.hero h1 {
    color: white;
    margin-bottom: 1rem;
    font-size: 3.5rem;
}

.hero p {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background-color: var(--accent-orange);
    border: none;
    color: white;
    padding: 12px 30px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: inline-block;
    margin: 5px;
}

.btn-primary:hover {
    background-color: #d68910;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 10px 28px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 5px;
}

.btn-secondary:hover {
    background-color: var(--accent-orange);
    color: white;
    text-decoration: none;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background-color: white;
    border-radius: 6px;
    transition: all 0.2s ease-out;
    height: 100%;
    border-left: 4px solid var(--neutral-gray);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-left-color: var(--accent-orange);
    transform: translateY(-2px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--neutral-gray);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.card-text {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.img-hero {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.img-section {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* Lists */
ul, ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
    line-height: 1.8;
}

li {
    margin-bottom: 0.8rem;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--accent-orange);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #555;
    background-color: rgba(189, 195, 199, 0.1);
    padding: 1.5rem;
    border-radius: 4px;
}

/* Accordion / FAQ */
.accordion {
    background-color: transparent;
}

.accordion .card {
    border: 1px solid var(--neutral-gray);
    margin-bottom: 1rem;
}

.accordion .card-header {
    background-color: transparent;
    padding: 0;
}

.accordion .card-header button {
    display: block;
    width: 100%;
    text-align: left;
    background-color: white;
    border: none;
    color: var(--primary-color);
    padding: 1.2rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.accordion .card-header button:hover {
    background-color: rgba(243, 156, 18, 0.05);
    color: var(--accent-orange);
}

.accordion .card-header button::after {
    content: '▼';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: var(--accent-orange);
}

.accordion .card-header button[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
}

.accordion .card-body {
    padding: 1.5rem;
    background-color: rgba(44, 62, 80, 0.02);
    color: #555;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    background-color: white;
    border: 1px solid var(--neutral-gray);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.2s ease;
    color: var(--primary-color);
}

.form-control:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.25);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* Tables */
table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--neutral-gray);
}

tbody tr:nth-child(even) {
    background-color: rgba(189, 195, 199, 0.05);
}

tbody tr:hover {
    background-color: rgba(243, 156, 18, 0.05);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    margin-top: auto;
}

footer h5 {
    color: var(--accent-orange);
    margin-bottom: 1rem;
}

footer a {
    color: var(--secondary-color);
}

footer a:hover {
    color: var(--accent-orange);
}

.border-secondary {
    border-color: var(--neutral-gray) !important;
}

/* Grid System Enhancements */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
    padding: 15px;
}

/* Content Styling */
.content-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.content-section.reverse {
    flex-direction: row-reverse;
}

.content-text {
    flex: 1;
}

.content-image {
    flex: 1;
}

.content-image img {
    width: 100%;
    height: auto;
}

/* Key Concepts Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.bg-light {
    background-color: var(--secondary-color) !important;
}

.bg-dark {
    background-color: var(--primary-color) !important;
}

.text-dark {
    color: var(--primary-color) !important;
}

.text-light {
    color: var(--text-light) !important;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .container, .container-lg {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .content-section {
        flex-direction: column !important;
        gap: 2rem;
    }
    
    .content-section.reverse {
        flex-direction: column;
    }
    
    .concept-grid {
        grid-template-columns: 1fr;
    }
    
    .img-hero {
        height: 250px;
    }
    
    .img-section {
        height: 200px;
    }

    .navbar-nav {
        margin-top: 1rem;
    }

    .navbar-nav .nav-link {
        margin-left: 0;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .container, .container-lg {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
}
