/* StealARecipe — frontend (public site) styles */

:root {
    --sar-primary: #004225;
    --sar-secondary: #2c3e50;
    --sar-accent: #f39c12;
    --sar-light: #ecf0f1;
}

/* Green focus glow on form fields (overrides Bootstrap's blue) */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--sar-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 66, 37, 0.25);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--sar-primary) !important;
}

.navbar-brand i {
    color: var(--sar-accent);
}

.btn-primary {
    background-color: var(--sar-primary);
    border-color: var(--sar-primary);
}

.btn-primary:hover {
    background-color: #00311a;
    border-color: #00311a;
}

.btn-outline-secondary:hover {
    background-color: var(--sar-primary);
    border-color: var(--sar-primary);
    color: white;
}

.btn-outline-primary {
    color: var(--sar-primary);
    border-color: var(--sar-primary);
}

.btn-outline-primary:hover {
    background-color: var(--sar-primary);
    border-color: var(--sar-primary);
    color: white;
}

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

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

.recipe-card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.recipe-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.recipe-card .card-title a {
    color: var(--sar-secondary);
    text-decoration: none;
}

.recipe-card .card-title a:hover {
    color: var(--sar-primary);
}

.category-badge {
    background-color: var(--sar-accent);
    color: white;
    font-size: 0.75rem;
}

.footer {
    background-color: var(--sar-primary);
    color: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Add padding to main content to account for fixed footer */
.container-fluid {
    padding-bottom: 60px;
}

.footer a {
    color: var(--sar-light);
}

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

.sidebar-card {
    border-left: 4px solid var(--sar-primary);
}

.category-card {
    transition: border-left 0.2s ease, transform 0.2s ease;
    border-left: 4px solid transparent !important;
}

.category-card:hover {
    border-left: 4px solid var(--sar-primary) !important;
    transform: translateX(3px);
}

.ingredient-tag {
    background-color: var(--sar-light);
    color: var(--sar-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: inline-block;
    margin: 0.25rem;
}

.views-count {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Header nav styles */
.navbar .nav-link:hover {
    background-color: rgba(255,255,255,0.15);
}

/* Sidebar Styles */
.sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    position: fixed;
    top: 175px;
    bottom: 50px;
    left: 0;
    width: 16.666667%;
    /* Whole nav is a single scroll pane, independent of the page */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-sticky {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* "Categories" heading stays visible while the list scrolls past it */
.sidebar .sidebar-heading.sidebar-section-fixed {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 1;
}

/* Offset main content for fixed sidebar */
@media (min-width: 992px) {
    main.col-lg-10 {
        margin-left: 16.666667%;
        width: 83.333333%;
    }
}

/* Custom scrollbar for the sidebar nav */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sar-primary);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #00311a;
}

.sidebar-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sar-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid var(--sar-primary);
    margin-bottom: 0.5rem;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 0;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background-color: var(--sar-primary);
    color: white;
}

.sidebar .nav-link .badge {
    font-size: 0.7rem;
}

/* Pagination styling */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: var(--sar-primary);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--sar-primary);
    border-color: var(--sar-primary);
    color: white;
}

.pagination .page-link:hover {
    background-color: var(--sar-primary);
    border-color: var(--sar-primary);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    header, .navbar, .footer, .breadcrumb, .no-print, nav, .sidebar {
        display: none !important;
    }

    .col-lg-10 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Reset backgrounds and shadows */
    body {
        background: white !important;
        font-size: 10pt;
        line-height: 1.3;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 10pt !important;
    }

    .card-header {
        background: #004225 !important;
        color: white !important;
        padding: 5pt 10pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card-header h4, .card-header h5 {
        font-size: 12pt !important;
        margin: 0 !important;
    }

    .card-body {
        padding: 8pt !important;
    }

    /* Recipe image */
    .card-img-top {
        max-height: 150px !important;
        object-fit: cover;
    }

    /* Show recipe title prominently */
    h1.card-title,
    h2.card-title {
        display: block !important;
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 10pt !important;
        color: #004225;
        border-bottom: 2px solid #004225;
        padding-bottom: 5pt;
    }

    /* Hide meta info, categories, badges but not the title container */
    .badge, .gap-3 {
        display: none !important;
    }

    .text-muted {
        display: none !important;
    }

    /* Format sections */
    .print-section {
        page-break-inside: avoid;
    }

    .print-title {
        display: none !important;
    }

    /* Two column layout for print */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .col-lg-8 {
        width: 60% !important;
        max-width: 60% !important;
        flex: 0 0 60% !important;
        padding-right: 10pt !important;
    }

    .col-lg-4 {
        width: 40% !important;
        max-width: 40% !important;
        flex: 0 0 40% !important;
    }

    /* Ingredient list styling */
    .list-unstyled {
        margin: 0 !important;
    }

    .list-unstyled li {
        padding: 1pt 0;
        font-size: 9pt;
    }

    .list-unstyled li i {
        display: none;
    }

    /* Hide related recipes */
    .col-lg-4 .card:not(.print-ingredients) {
        display: none !important;
    }

    /* Show ingredients card */
    .print-ingredients {
        display: block !important;
    }

    /* Links should be black */
    a {
        color: black !important;
        text-decoration: none !important;
    }

    /* Fit on one page */
    @page {
        margin: 0.5cm;
        size: auto;
    }

    /* Directions text smaller */
    .directions-content {
        font-size: 9pt;
        line-height: 1.4;
    }
}
