/*---------------------------------
  Global Layout & Background
----------------------------------*/
html, body {
    height: 100%;
    margin: 0;
}
body {
    background: url("../images/body-background.jpg") repeat center center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1 0 auto;
}

/* Navbar styling */
.navbar-brand {
    font-weight: bold;
}
.nav-link.fw-bold {
    color: #343a40;
    transition: color 0.2s ease-in-out;
}
.nav-link.fw-bold:hover {
    color: #dc3545;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 3rem 0;
    background: url("../images/home_background.jpg") no-repeat center center;
    background-size: cover;
    color: #fff;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}
.hero-content {
    position: relative;
    z-index: 2;
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}
.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 500px;
    color: #f0f0f0;
}
.input-group-wider {
    max-width: 600px;
    margin: 0 auto;
}

/* Results Section */
#resultsSection {
    display: none;
}
.recipe-heading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 768px) {
    .recipe-heading {
        flex-direction: row;
        align-items: center;
    }
}
.recipe-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}
.recipe-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}
.recipe-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.recipe-domain {
    font-size: 0.875rem;
    color: #6c757d;
}
.recipe-badges {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.recipe-badges .badge {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #212529;
    font-weight: 500;
}
.recipe-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Nutrition label styling */
.nutrition-label {
    width: 280px;
    border: 2px solid #000;
    padding: 10px;
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #000;
}
.nutrition-label .nf-heading {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Print styles */
@media print {
    #heroSection,
    #resultsRecipeUrl,
    #resultsFetchBtn,
    #recipeActions,
    #additionalInfo,
    nav,
    footer {
        display: none !important;
    }
    #printCredit {
        display: block !important;
    }
    .card {
        border: none;
        width: 100% !important;
    }
}
#printCredit {
    display: none;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #555;
}

/* Footer pinned at bottom */
footer {
    margin-top: auto;
    background-color: #fff;
    border-top: 1px solid #ddd;
    padding: 1rem 0;
    flex-shrink: 0;
}
footer .footer-text {
    text-align: center;
    width: 100%;
}

/* Error Screen */
.error-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.error-subtext {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Screen-reader only */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Dark mode styling */
body.dark-mode {
    background-color: #121212;
    color: #eee;
}
body.dark-mode .card {
    background-color: #1e1e1e;
    color: #fff;
}
body.dark-mode .navbar,
body.dark-mode footer {
    background-color: #1e1e1e;
}
body.dark-mode a,
body.dark-mode .nav-link {
    color: #fff !important;
}
body.dark-mode .btn {
    color: #fff;
    background-color: #444;
    border-color: #666;
}
