/* Compact Mode Styles - Reduces spacing throughout the site */

/* Restaurant Detail Page - Background Color */
body.restaurant-detail-page {
    background-color: #f8f9fa !important; /* Light gray */
}

/* Restaurant Detail Page - Hero Image Section */
.restaurant-hero-section {
    width: 100% !important;
    height: 500px !important;
    margin-top: 0 !important;
    padding-top: 80px !important; /* Room for navbar */
}

.restaurant-hero-section .restaurant-hero-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.restaurant-hero-section .restaurant-hero-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent) !important;
}

.restaurant-hero-section h1 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

/* Ensure no white space at top of restaurant detail page */
.restaurant-hero-section + .container {
    margin-top: 0 !important;
}

/* Override first-of-type padding for restaurant detail page */
body.restaurant-detail-page > div:first-of-type {
    padding-top: 0 !important;
}

/* FORCE two-column layout for search fields on all modes */
.advanced-filters .col-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

/* ===== NORMAL/SPACIOUS VIEW - COMPACT SEARCH SECTION ===== */

/* Make search section ULTRA compact in normal view */
.hero-section {
    padding-bottom: 0.5rem !important;
}

.hero-section .card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.hero-section .card-body {
    padding: 1rem !important;
}

/* Search header section */
.hero-section .search-header {
    margin-bottom: 0.4rem !important;
}

.hero-section h1,
.hero-section .display-5 {
    font-size: 1.2rem !important;
    margin-bottom: 0.15rem !important;
    line-height: 1.1 !important;
}

.hero-section .lead {
    font-size: 0.75rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* Compact form fields in normal view - ULTRA MINIMAL SPACING */
.advanced-search-container {
    max-width: 650px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.advanced-filters {
    margin: 0 !important;
    padding: 0 !important;
}

.advanced-filters .row {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove all Bootstrap default spacing from form wrapper */
#advanced-search-form .row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#advanced-search-form .col-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.advanced-filters .row.g-2,
.advanced-filters .row.g-3 {
    --bs-gutter-x: 0.15rem !important;
    --bs-gutter-y: 0.05rem !important;
    margin-left: -0.075rem !important;
    margin-right: -0.075rem !important;
}

.advanced-filters .row > * {
    padding-left: 0.075rem !important;
    padding-right: 0.075rem !important;
}

.advanced-filters .col-6 {
    padding-left: 0.075rem !important;
    padding-right: 0.075rem !important;
    margin-bottom: 0.05rem !important;
}

.advanced-filters .form-label {
    font-size: 0.6rem !important;
    margin-bottom: 0.02rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

.advanced-filters .form-select,
.advanced-filters select,
.advanced-filters input {
    font-size: 0.65rem !important;
    padding: 0.12rem 0.25rem !important;
    height: 1.2rem !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
}

.advanced-filters .btn {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.25rem !important;
    height: 1.25rem !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
}

/* Specifically target the filter buttons */
.advanced-filters button.btn,
.advanced-filters button[type="button"],
.advanced-filters button[type="submit"] {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.25rem !important;
    height: 1.25rem !important;
    line-height: 1 !important;
    min-height: 1.25rem !important;
    max-height: 1.25rem !important;
}

/* Remove default Bootstrap spacing */
.advanced-filters .mb-3,
.advanced-filters .mb-2,
.advanced-filters .mb-1 {
    margin-bottom: 0 !important;
}

/* Target the specific row containing fields */
form .row.g-3.mb-3,
form .row.g-2.mb-3 {
    margin-bottom: 0.1rem !important;
}

/* Remove spacing from the form wrapper */
form#advanced-search-form {
    margin: 0 !important;
    padding: 0 !important;
}

form#advanced-search-form > .row {
    margin-bottom: 0 !important;
}

/* Target all col-12 wrappers */
.advanced-filters .col-12 {
    padding: 0 !important;
    margin: 0 !important;
}

/* Reduce all row margins in search section */
.hero-section .row {
    margin-bottom: 0 !important;
}

/* ULTRA Compact badges section in normal view */
.hero-section .mt-4 {
    margin-top: 0.5rem !important;
}

.hero-section .pt-4 {
    padding-top: 0.5rem !important;
}

.hero-section h6 {
    font-size: 0.65rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1 !important;
}

.hero-section .badge,
.hero-section .city-badge,
.hero-section .dietary-badge {
    font-size: 0.6rem !important;
    padding: 0.12rem 0.3rem !important;
    margin: 0.06rem !important;
    line-height: 1 !important;
    height: 1.15rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Clear All Filters button */
.hero-section .btn-sm {
    font-size: 0.6rem !important;
    padding: 0.12rem 0.3rem !important;
    line-height: 1 !important;
    height: 1.15rem !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    margin-bottom: 0.06rem !important;
}

.hero-section .border-top {
    margin-top: 0.4rem !important;
    padding-top: 0.4rem !important;
}

/* Responsive adjustments for normal view - ULTRA MINIMAL */
@media (max-width: 768px) {
    /* Override body padding for restaurant detail page */
    body.restaurant-detail-page > div:first-of-type {
        padding-top: 0 !important;
    }

    /* Restaurant Detail Hero - Tablet */
    .restaurant-hero-section {
        height: 400px !important;
        margin-top: 0 !important;
        padding-top: 70px !important;
    }

    .restaurant-hero-section h1 {
        font-size: 1.3rem !important;
    }

    .hero-section .card-body {
        padding: 0.75rem !important;
    }

    .hero-section .search-header {
        margin-bottom: 0.3rem !important;
    }

    .hero-section h1,
    .hero-section .display-5 {
        font-size: 1.1rem !important;
        margin-bottom: 0.12rem !important;
    }

    .hero-section .lead {
        font-size: 0.7rem !important;
        margin-bottom: 0 !important;
    }

    .hero-section h6 {
        font-size: 0.65rem !important;
        margin-bottom: 0.2rem !important;
    }

    .hero-section .badge,
    .hero-section .city-badge,
    .hero-section .dietary-badge {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.25rem !important;
        margin: 0.05rem !important;
        line-height: 1 !important;
        height: 1.05rem !important;
    }

    .hero-section .btn-sm {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.25rem !important;
        line-height: 1 !important;
        height: 1.05rem !important;
        vertical-align: middle !important;
        margin-bottom: 0.05rem !important;
    }

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

    .advanced-filters .row.g-2,
    .advanced-filters .row.g-3 {
        margin-left: -0.06rem !important;
        margin-right: -0.06rem !important;
        --bs-gutter-x: 0.12rem !important;
        --bs-gutter-y: 0.04rem !important;
    }

    .advanced-filters .row > * {
        padding-left: 0.06rem !important;
        padding-right: 0.06rem !important;
    }

    .advanced-filters .col-6 {
        padding-left: 0.06rem !important;
        padding-right: 0.06rem !important;
        margin-bottom: 0.04rem !important;
    }

    .advanced-filters .form-label {
        font-size: 0.6rem !important;
        margin-bottom: 0.05rem !important;
    }

    .advanced-filters .form-select,
    .advanced-filters select,
    .advanced-filters input {
        font-size: 0.58rem !important;
        padding: 0.12rem 0.22rem !important;
        height: 1.1rem !important;
        line-height: 1 !important;
    }

    .advanced-filters .btn {
        font-size: 0.6rem !important;
        padding: 0.12rem 0.2rem !important;
        height: 1.15rem !important;
        line-height: 1 !important;
    }

    .advanced-filters button.btn,
    .advanced-filters button[type="button"],
    .advanced-filters button[type="submit"] {
        font-size: 0.6rem !important;
        padding: 0.12rem 0.2rem !important;
        height: 1.15rem !important;
        line-height: 1 !important;
        min-height: 1.15rem !important;
        max-height: 1.15rem !important;
    }
}

@media (max-width: 575px) {
    /* Override body padding for restaurant detail page */
    body.restaurant-detail-page > div:first-of-type {
        padding-top: 0 !important;
    }

    /* Restaurant Detail Hero - Mobile */
    .restaurant-hero-section {
        height: 350px !important;
        margin-top: 0 !important;
        padding-top: 65px !important;
    }

    .restaurant-hero-section h1 {
        font-size: 1.1rem !important;
    }

    .restaurant-hero-section .p-4 {
        padding: 0.5rem !important;
    }

    .hero-section .card-body {
        padding: 0.5rem !important;
    }

    .hero-section .search-header {
        margin-bottom: 0.25rem !important;
    }

    .hero-section h1,
    .hero-section .display-5 {
        font-size: 1rem !important;
        margin-bottom: 0.1rem !important;
    }

    .hero-section .lead {
        font-size: 0.65rem !important;
        margin-bottom: 0 !important;
    }

    .hero-section h6 {
        font-size: 0.6rem !important;
        margin-bottom: 0.18rem !important;
    }

    .hero-section .badge,
    .hero-section .city-badge,
    .hero-section .dietary-badge {
        font-size: 0.5rem !important;
        padding: 0.08rem 0.2rem !important;
        margin: 0.04rem !important;
        line-height: 1 !important;
        height: 0.95rem !important;
    }

    .hero-section .btn-sm {
        font-size: 0.5rem !important;
        padding: 0.08rem 0.2rem !important;
        line-height: 1 !important;
        height: 0.95rem !important;
        vertical-align: middle !important;
        margin-bottom: 0.04rem !important;
    }

    .advanced-filters .row.g-2,
    .advanced-filters .row.g-3 {
        margin-left: -0.05rem !important;
        margin-right: -0.05rem !important;
        --bs-gutter-x: 0.1rem !important;
        --bs-gutter-y: 0.03rem !important;
    }

    .advanced-filters .row > * {
        padding-left: 0.05rem !important;
        padding-right: 0.05rem !important;
    }

    .advanced-filters .col-6 {
        padding-left: 0.05rem !important;
        padding-right: 0.05rem !important;
        margin-bottom: 0.03rem !important;
    }

    .advanced-filters .form-label {
        margin-bottom: 0.04rem !important;
        font-size: 0.55rem !important;
    }

    .advanced-filters .form-select,
    .advanced-filters select,
    .advanced-filters input {
        font-size: 0.52rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.05rem !important;
        line-height: 1 !important;
    }

    .advanced-filters .btn {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.1rem !important;
        line-height: 1 !important;
    }

    .advanced-filters button.btn,
    .advanced-filters button[type="button"],
    .advanced-filters button[type="submit"] {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.1rem !important;
        line-height: 1 !important;
        min-height: 1.1rem !important;
        max-height: 1.1rem !important;
    }
}

/* ===== END NORMAL VIEW COMPACT SEARCH ===== */

/* ===== COMPACT MODE SEARCH SECTION - COMPLETE REDESIGN ===== */

/* Ultra compact hero section in compact mode */
body.compact-mode .hero-section {
    padding-top: 52px !important;
    padding-bottom: 0.3rem !important;
}

body.compact-mode .hero-section .card {
    margin-bottom: 0 !important;
}

body.compact-mode .hero-section .card-body {
    padding: 0.75rem !important;
}

/* Compact search header */
body.compact-mode .hero-section .search-header {
    margin-bottom: 0.3rem !important;
}

/* Compact title and lead */
body.compact-mode .hero-section h1,
body.compact-mode .hero-section .display-5 {
    font-size: 0.9rem !important;
    margin-bottom: 0.1rem !important;
    line-height: 1.1 !important;
}

body.compact-mode .hero-section .lead {
    font-size: 0.6rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* CRITICAL: Force 2-column grid in compact mode */
body.compact-mode .advanced-filters {
    max-width: 500px !important;
    margin: 0 auto !important;
}

body.compact-mode .advanced-filters .row {
    margin-left: -0.08rem !important;
    margin-right: -0.08rem !important;
}

body.compact-mode .advanced-filters .row.g-2,
body.compact-mode .advanced-filters .row.g-3 {
    --bs-gutter-x: 0.16rem !important;
    --bs-gutter-y: 0.04rem !important;
}

body.compact-mode .advanced-filters .col-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding-left: 0.08rem !important;
    padding-right: 0.08rem !important;
    margin-bottom: 0.04rem !important;
}

/* Ultra compact form fields */
body.compact-mode .advanced-filters .form-label {
    font-size: 0.5rem !important;
    margin-bottom: 0.02rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

body.compact-mode .advanced-filters .form-select,
body.compact-mode .advanced-filters select,
body.compact-mode .advanced-filters input {
    font-size: 0.55rem !important;
    padding: 0.12rem 0.22rem !important;
    height: 1.1rem !important;
    line-height: 1 !important;
    border-radius: 0.25rem !important;
}

body.compact-mode .advanced-filters .btn {
    font-size: 0.55rem !important;
    padding: 0.12rem 0.2rem !important;
    height: 1.1rem !important;
    line-height: 1 !important;
    border-radius: 0.25rem !important;
    white-space: nowrap !important;
}

body.compact-mode .advanced-filters button.btn,
body.compact-mode .advanced-filters button[type="button"],
body.compact-mode .advanced-filters button[type="submit"] {
    font-size: 0.55rem !important;
    padding: 0.12rem 0.2rem !important;
    height: 1.1rem !important;
    line-height: 1 !important;
    min-height: 1.1rem !important;
    max-height: 1.1rem !important;
}

/* Remove default row gaps */
body.compact-mode .advanced-filters .row.g-2 {
    --bs-gutter-x: 0.5rem !important;
    --bs-gutter-y: 0 !important;
}

/* Compact badges section */
body.compact-mode .hero-section .mt-4 {
    margin-top: 0.5rem !important;
}

body.compact-mode .hero-section .pt-4 {
    padding-top: 0.5rem !important;
}

body.compact-mode .hero-section h6 {
    font-size: 0.55rem !important;
    margin-bottom: 0.15rem !important;
}

body.compact-mode .hero-section .badge,
body.compact-mode .hero-section .city-badge,
body.compact-mode .hero-section .dietary-badge {
    font-size: 0.5rem !important;
    padding: 0.1rem 0.25rem !important;
    margin: 0.08rem !important;
    line-height: 1 !important;
    height: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

body.compact-mode .hero-section .btn-sm {
    font-size: 0.5rem !important;
    padding: 0.1rem 0.25rem !important;
    line-height: 1 !important;
    height: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    margin-bottom: 0.08rem !important;
}

/* Mobile compact mode */
@media (max-width: 768px) {
    body.compact-mode > div:first-of-type {
        padding-top: 50px !important;
    }

    /* Override for restaurant detail page */
    body.compact-mode.restaurant-detail-page > div:first-of-type {
        padding-top: 0 !important;
    }

    body.compact-mode .restaurant-hero-section {
        margin-top: 0 !important;
        padding-top: 50px !important;
        height: 300px !important;
    }

    body.compact-mode .hero-section,
    body.compact-mode header.position-relative,
    body.compact-mode .page-header,
    body.compact-mode .blog-hero {
        padding-top: 50px !important;
        padding-bottom: 0.25rem !important;
    }

    body.compact-mode .container.mt-4:first-child {
        margin-top: 2.75rem !important;
    }

    body.compact-mode .hero-section .card-body {
        padding: 0.5rem !important;
    }

    body.compact-mode .hero-section .search-header {
        margin-bottom: 0.25rem !important;
    }

    body.compact-mode .hero-section h1,
    body.compact-mode .hero-section .display-5 {
        font-size: 0.8rem !important;
        margin-bottom: 0.08rem !important;
    }

    body.compact-mode .hero-section .lead {
        font-size: 0.55rem !important;
        margin-bottom: 0 !important;
    }

    body.compact-mode .hero-section h6 {
        font-size: 0.48rem !important;
        margin-bottom: 0.12rem !important;
    }

    body.compact-mode .hero-section .badge,
    body.compact-mode .hero-section .city-badge,
    body.compact-mode .hero-section .dietary-badge {
        font-size: 0.45rem !important;
        padding: 0.08rem 0.18rem !important;
        margin: 0.06rem !important;
        line-height: 1 !important;
        height: 0.9rem !important;
    }

    body.compact-mode .hero-section .btn-sm {
        font-size: 0.45rem !important;
        padding: 0.08rem 0.18rem !important;
        line-height: 1 !important;
        height: 0.9rem !important;
        vertical-align: middle !important;
        margin-bottom: 0.06rem !important;
    }

    body.compact-mode .advanced-filters {
        max-width: 100% !important;
    }

    body.compact-mode .advanced-filters .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
    }

    body.compact-mode .advanced-filters .form-label {
        font-size: 0.45rem !important;
        margin-bottom: 0.05rem !important;
    }

    body.compact-mode .advanced-filters .form-select,
    body.compact-mode .advanced-filters select,
    body.compact-mode .advanced-filters input {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.05rem !important;
        line-height: 1 !important;
    }

    body.compact-mode .advanced-filters .btn {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.05rem !important;
        line-height: 1 !important;
    }

    body.compact-mode .advanced-filters button.btn,
    body.compact-mode .advanced-filters button[type="button"],
    body.compact-mode .advanced-filters button[type="submit"] {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.18rem !important;
        height: 1.05rem !important;
        line-height: 1 !important;
        min-height: 1.05rem !important;
        max-height: 1.05rem !important;
    }
}

/* Extra small screens */
@media (max-width: 575px) {
    body.compact-mode > div:first-of-type {
        padding-top: 48px !important;
    }

    /* Override for restaurant detail page */
    body.compact-mode.restaurant-detail-page > div:first-of-type {
        padding-top: 0 !important;
    }

    body.compact-mode .restaurant-hero-section {
        margin-top: 0 !important;
        padding-top: 48px !important;
        height: 280px !important;
    }

    body.compact-mode .hero-section,
    body.compact-mode header.position-relative,
    body.compact-mode .page-header,
    body.compact-mode .blog-hero {
        padding-top: 48px !important;
        padding-bottom: 0.2rem !important;
    }

    body.compact-mode .container.mt-4:first-child {
        margin-top: 2.5rem !important;
    }

    body.compact-mode .hero-section .card-body {
        padding: 0.4rem !important;
    }

    body.compact-mode .hero-section .search-header {
        margin-bottom: 0.2rem !important;
    }

    body.compact-mode .hero-section h1,
    body.compact-mode .hero-section .display-5 {
        font-size: 0.7rem !important;
        margin-bottom: 0.06rem !important;
    }

    body.compact-mode .hero-section .lead {
        font-size: 0.5rem !important;
        margin-bottom: 0 !important;
    }

    body.compact-mode .hero-section h6 {
        font-size: 0.42rem !important;
        margin-bottom: 0.1rem !important;
    }

    body.compact-mode .hero-section .badge,
    body.compact-mode .hero-section .city-badge,
    body.compact-mode .hero-section .dietary-badge {
        font-size: 0.4rem !important;
        padding: 0.06rem 0.14rem !important;
        margin: 0.05rem !important;
        line-height: 1 !important;
        height: 0.8rem !important;
    }

    body.compact-mode .hero-section .btn-sm {
        font-size: 0.4rem !important;
        padding: 0.06rem 0.14rem !important;
        line-height: 1 !important;
        height: 0.8rem !important;
        vertical-align: middle !important;
        margin-bottom: 0.05rem !important;
    }

    body.compact-mode .advanced-filters .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 0.15rem !important;
        padding-right: 0.15rem !important;
    }

    body.compact-mode .advanced-filters .form-label {
        font-size: 0.4rem !important;
    }

    body.compact-mode .advanced-filters .form-select,
    body.compact-mode .advanced-filters select,
    body.compact-mode .advanced-filters input {
        font-size: 0.48rem !important;
        padding: 0.08rem 0.15rem !important;
        height: 1rem !important;
        line-height: 1 !important;
    }

    body.compact-mode .advanced-filters .btn {
        font-size: 0.48rem !important;
        padding: 0.08rem 0.15rem !important;
        height: 1rem !important;
        line-height: 1 !important;
    }

    body.compact-mode .advanced-filters button.btn,
    body.compact-mode .advanced-filters button[type="button"],
    body.compact-mode .advanced-filters button[type="submit"] {
        font-size: 0.48rem !important;
        padding: 0.08rem 0.15rem !important;
        height: 1rem !important;
        line-height: 1 !important;
        min-height: 1rem !important;
        max-height: 1rem !important;
    }
}

/* ===== END COMPACT SEARCH SECTION ===== */

/* Ensure navbar container stays on top and has proper z-index */
.position-sticky.z-index-sticky {
    z-index: 1020;
}

.navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Fix for position-absolute navbar blocking content */
/* Add minimal padding to first content element to clear navbar */
body > div:first-of-type {
    padding-top: 58px;
}

/* Remove padding for pages with hero sections that start at top */
body.index-page > div:first-of-type {
    padding-top: 0 !important;
}

/* Specific targeting for common page structures */
.hero-section,
header.position-relative,
.page-header,
.blog-hero {
    padding-top: 120px !important;
}

.container.mt-4:first-child {
    margin-top: 3.75rem !important;
}

/* Remove any extra margins on main content sections */
main,
.main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure first elements in sections don't have extra top margin */
section:first-of-type,
.container:first-of-type,
.row:first-of-type {
    margin-top: 0 !important;
}

/* Mobile navbar adjustments */
@media (max-width: 991px) {
    .navbar {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    body > div:first-of-type {
        padding-top: 56px;
    }

    /* Remove padding for pages with hero sections that start at top */
    body.index-page > div:first-of-type {
        padding-top: 0 !important;
    }

    .hero-section,
    header.position-relative,
    .page-header,
    .blog-hero {
        padding-top: 110px !important;
    }

    .container.mt-4:first-child {
        margin-top: 3.5rem !important;
    }
}

@media (max-width: 575px) {
    .navbar {
        margin-left: 0.25rem !important;
        margin-right: 0.25rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body > div:first-of-type {
        padding-top: 54px;
    }

    /* Remove padding for pages with hero sections that start at top */
    body.index-page > div:first-of-type {
        padding-top: 0 !important;
    }

    .hero-section,
    header.position-relative,
    .page-header,
    .blog-hero {
        padding-top: 100px !important;
    }

    .container.mt-4:first-child {
        margin-top: 3.25rem !important;
    }
}

/* Compact mode - minimal navbar spacing */
body.compact-mode > div:first-of-type {
    padding-top: 52px !important;
}

/* Remove padding for pages with hero sections that start at top */
body.compact-mode.index-page > div:first-of-type {
    padding-top: 0 !important;
}

body.compact-mode .hero-section,
body.compact-mode header.position-relative,
body.compact-mode .page-header,
body.compact-mode .blog-hero {
    padding-top: 100px !important;
}

body.compact-mode .container.mt-4:first-child {
    margin-top: 3rem !important;
}

/* Remove extra spacing in compact mode */
body.compact-mode section:first-of-type {
    margin-top: 0 !important;
}

body.compact-mode .container {
    padding-top: 0 !important;
}

/* Advanced filter section (hidden "More" section) */
#advanced-filters-section .form-label {
    font-size: 0.6rem !important;
    margin-bottom: 0.06rem !important;
}

#advanced-filters-section .form-select,
#advanced-filters-section select {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.3rem !important;
    height: 1.25rem !important;
    line-height: 1 !important;
}

/* Advanced filter section in compact mode */
body.compact-mode #advanced-filters-section .form-label {
    font-size: 0.48rem !important;
    margin-bottom: 0.06rem !important;
}

body.compact-mode #advanced-filters-section .form-select,
body.compact-mode #advanced-filters-section select {
    font-size: 0.55rem !important;
    padding: 0.12rem 0.22rem !important;
    height: 1.1rem !important;
    line-height: 1 !important;
}

/* Compact restaurant cards on home page - Normal View */
.hover-lift .card-img-top,
.hover-lift img {
    height: 80px !important;
}

.hover-lift .card-body {
    padding: 0.4rem !important;
}

.hover-lift h6 {
    font-size: 0.7rem !important;
    margin-bottom: 0.2rem !important;
}

.hover-lift .text-muted {
    font-size: 0.6rem !important;
    margin-bottom: 0.2rem !important;
}

.hover-lift .badge {
    font-size: 0.55rem !important;
    padding: 0.12rem 0.25rem !important;
}

.hover-lift small {
    font-size: 0.55rem !important;
}

/* Make trending section more compact */
section.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

section.py-3 h4 {
    font-size: 1rem !important;
}

/* Compact restaurant cards on search page - Normal View */
.restaurant-card .card-img-top,
.restaurant-card .restaurant-image {
    height: 140px !important;
}

.restaurant-card .card-body {
    padding: 0.5rem !important;
}

.restaurant-card .card-title {
    font-size: 0.85rem !important;
    margin-bottom: 0.3rem !important;
}

.restaurant-card .card-title a {
    font-size: 0.85rem !important;
}

.restaurant-card .card-title small {
    font-size: 0.65rem !important;
}

.restaurant-card .card-text {
    font-size: 0.65rem !important;
    margin-bottom: 0.25rem !important;
}

.restaurant-card .badge {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.3rem !important;
    margin: 0.1rem !important;
}

.restaurant-card .star-rating i {
    font-size: 0.75rem !important;
}

.restaurant-card .fw-semibold {
    font-size: 0.75rem !important;
}

.restaurant-card small {
    font-size: 0.65rem !important;
}

.restaurant-card .btn-sm {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.5rem !important;
}

.restaurant-card .d-flex.gap-2 {
    gap: 0.3rem !important;
}

.restaurant-card .mb-2 {
    margin-bottom: 0.3rem !important;
}

.restaurant-card .mb-4 {
    margin-bottom: 0.5rem !important;
}

/* Reduce spacing in restaurant item grid */
.restaurant-item {
    margin-bottom: 0.75rem !important;
}

/* Compact image overlay */
.restaurant-card .image-overlay {
    padding: 0.3rem !important;
}

.restaurant-card .image-overlay small {
    font-size: 0.6rem !important;
}

body.compact-mode {

    /* Restaurant Detail Page - Compact Mode */
    .restaurant-hero-section {
        height: 350px !important;
        margin-top: 0 !important;
        padding-top: 60px !important;
    }

    .restaurant-hero-section h1 {
        font-size: 1.2rem !important;
    }

    .restaurant-hero-section .p-4 {
        padding: 0.75rem !important;
    }

    /* Compact search results section */
    .search-results-header h4 {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }

    .search-results-header p {
        font-size: 0.75rem !important;
    }

    /* Compact restaurant cards on search page - Even more compact in compact mode */
    .restaurant-card .card-img-top,
    .restaurant-card .restaurant-image {
        height: 100px !important;
    }

    .restaurant-card .card-body {
        padding: 0.35rem !important;
    }

    .restaurant-card .card-title {
        font-size: 0.75rem !important;
        margin-bottom: 0.2rem !important;
    }

    .restaurant-card .card-title a {
        font-size: 0.75rem !important;
    }

    .restaurant-card .card-title small {
        font-size: 0.55rem !important;
    }

    .restaurant-card .card-text {
        font-size: 0.6rem !important;
        margin-bottom: 0.2rem !important;
    }

    .restaurant-card .badge {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.25rem !important;
        margin: 0.08rem !important;
    }

    .restaurant-card .star-rating i {
        font-size: 0.65rem !important;
    }

    .restaurant-card .fw-semibold {
        font-size: 0.65rem !important;
    }

    .restaurant-card small {
        font-size: 0.55rem !important;
    }

    .restaurant-card .btn-sm {
        font-size: 0.6rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    .restaurant-card .d-flex.gap-2 {
        gap: 0.25rem !important;
    }

    .restaurant-card .mb-2 {
        margin-bottom: 0.2rem !important;
    }

    .restaurant-card .mb-4 {
        margin-bottom: 0.35rem !important;
    }

    .restaurant-item {
        margin-bottom: 0.5rem !important;
    }

    .restaurant-card .image-overlay {
        padding: 0.2rem !important;
    }

    .restaurant-card .image-overlay small {
        font-size: 0.55rem !important;
    }

    /* Compact home page restaurant cards in compact mode */
    .hover-lift .card-img-top,
    .hover-lift img {
        height: 65px !important;
    }

    .hover-lift .card-body {
        padding: 0.3rem !important;
    }

    .hover-lift h6 {
        font-size: 0.6rem !important;
        margin-bottom: 0.15rem !important;
    }

    .hover-lift .text-muted {
        font-size: 0.5rem !important;
        margin-bottom: 0.15rem !important;
    }

    .hover-lift .badge {
        font-size: 0.48rem !important;
        padding: 0.08rem 0.2rem !important;
    }

    .hover-lift small {
        font-size: 0.48rem !important;
    }

    /* Compact trending section in compact mode */
    section.py-3 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    section.py-3 h4 {
        font-size: 0.85rem !important;
    }

    section.py-3 .btn-sm {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    /* Reduce section padding - MUCH more compact */
    section.py-7 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    section.py-5 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    section {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* Compact headers - MUCH smaller */
    .page-header {
        min-height: 120px !important;
    }

    header[style*="min-height: 350px"],
    header[style*="min-height: 400px"] {
        min-height: 100px !important;
    }

    header[style*="min-height: 250px"] {
        min-height: 80px !important;
    }

    header[style*="min-height: 200px"] {
        min-height: 80px !important;
    }

    /* Reduce display heading sizes - MUCH smaller */
    .display-3 {
        font-size: 1.5rem !important;
    }

    .display-4 {
        font-size: 1.25rem !important;
    }

    .display-5 {
        font-size: 1.125rem !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    h4 {
        font-size: 1rem !important;
    }

    h5 {
        font-size: 0.9375rem !important;
    }

    /* Compact lead text */
    .lead {
        font-size: 0.875rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* Reduce card padding - MUCH tighter */
    .card-body {
        padding: 0.5rem !important;
    }

    .card-body.p-2 {
        padding: 0.35rem !important;
    }

    .card-body.p-3 {
        padding: 0.5rem !important;
    }

    .card-body.p-4 {
        padding: 0.5rem !important;
    }

    .card-body.p-5 {
        padding: 0.65rem !important;
    }

    .card-body.py-7 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .card {
        margin-bottom: 0.5rem !important;
    }

    /* Compact margins and gaps - MUCH tighter */
    .mb-1 {
        margin-bottom: 0.15rem !important;
    }

    .mb-2 {
        margin-bottom: 0.25rem !important;
    }

    .mb-3 {
        margin-bottom: 0.35rem !important;
    }

    .mb-4 {
        margin-bottom: 0.5rem !important;
    }

    .mb-5 {
        margin-bottom: 0.65rem !important;
    }

    .mt-1 {
        margin-top: 0.15rem !important;
    }

    .mt-2 {
        margin-top: 0.25rem !important;
    }

    .mt-3 {
        margin-top: 0.35rem !important;
    }

    .mt-4 {
        margin-top: 0.5rem !important;
    }

    .mt-5 {
        margin-top: 0.65rem !important;
    }

    .my-1 {
        margin-top: 0.15rem !important;
        margin-bottom: 0.15rem !important;
    }

    .my-2 {
        margin-top: 0.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .my-3 {
        margin-top: 0.35rem !important;
        margin-bottom: 0.35rem !important;
    }

    .my-4 {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .my-5 {
        margin-top: 0.65rem !important;
        margin-bottom: 0.65rem !important;
    }

    .py-1 {
        padding-top: 0.15rem !important;
        padding-bottom: 0.15rem !important;
    }

    .py-2 {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }

    .py-3 {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    .py-4 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .py-5 {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    .pt-3 {
        padding-top: 0.35rem !important;
    }

    .pt-5 {
        padding-top: 0.65rem !important;
    }

    .pt-7 {
        padding-top: 0.75rem !important;
    }

    .pb-2 {
        padding-bottom: 0.25rem !important;
    }

    .pb-3 {
        padding-bottom: 0.35rem !important;
    }

    .pb-5 {
        padding-bottom: 0.65rem !important;
    }

    /* Compact list items - MUCH tighter */
    .list-group-item {
        padding: 0.35rem 0.5rem !important;
    }

    .list-group-item.py-4 {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    /* Reduce icon sizes - MUCH smaller */
    .icon-shape.icon-xxl {
        width: 30px !important;
        height: 30px !important;
    }

    .icon-shape.icon-xl {
        width: 28px !important;
        height: 28px !important;
    }

    .icon-shape.icon-lg {
        width: 26px !important;
        height: 26px !important;
    }

    .icon-shape {
        width: 24px !important;
        height: 24px !important;
    }

    /* Compact buttons - smaller */
    .btn {
        padding: 0.25rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    .btn-lg {
        padding: 0.35rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .btn-sm {
        padding: 0.15rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* Compact navbar */
    .navbar {
        padding: 0.25rem 0.5rem !important;
    }

    /* Reduce hero section padding - MUCH smaller */
    .hero-section {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* Compact blog sections */
    .blog-hero {
        min-height: 120px !important;
    }

    /* Compact restaurant cards */
    .restaurant-card {
        margin-bottom: 0.35rem !important;
    }

    /* Forum compact adjustments */
    .forum-topic-item {
        padding: 0.35rem !important;
    }

    /* Compact avatar sizes - MUCH smaller */
    .avatar.avatar-xxl {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
    }

    .avatar.avatar-xl {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }

    .avatar.avatar-lg {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.65rem !important;
    }

    .avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.625rem !important;
    }

    /* Reduce row gaps - MUCH tighter */
    .g-4 {
        gap: 0.35rem !important;
    }

    .g-3 {
        gap: 0.25rem !important;
    }

    .g-2 {
        gap: 0.15rem !important;
    }

    .row.g-4 > * {
        padding-right: 0.25rem !important;
        padding-left: 0.25rem !important;
        margin-bottom: 0.35rem !important;
    }

    /* Compact footer */
    .footer {
        padding-top: 0.75rem !important;
        margin-top: 0.75rem !important;
    }

    /* Compact feature sections */
    .feature-card .card-body {
        padding: 0.5rem !important;
    }

    /* Reduce vertical spacing in containers - MUCH tighter */
    .container.py-5,
    .container-fluid.py-5 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .container {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    /* Compact text spacing */
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 0.25rem !important;
        line-height: 1.2 !important;
    }

    p {
        margin-bottom: 0.35rem !important;
        line-height: 1.3 !important;
    }

    /* Reduce padding on hero content - MUCH smaller */
    [style*="padding-top: 60px"] {
        padding-top: 0.5rem !important;
    }

    [style*="padding-bottom: 60px"] {
        padding-bottom: 0.5rem !important;
    }

    [style*="padding-top: 30px"] {
        padding-top: 0.35rem !important;
    }

    [style*="padding-bottom: 30px"] {
        padding-bottom: 0.35rem !important;
    }

    /* Compact alert boxes */
    .alert {
        padding: 0.35rem 0.5rem !important;
        margin-bottom: 0.35rem !important;
        font-size: 0.875rem !important;
    }

    /* Compact breadcrumbs */
    .breadcrumb {
        margin-bottom: 0.35rem !important;
        padding: 0.25rem 0 !important;
        font-size: 0.8125rem !important;
    }

    /* Reduce input group sizes */
    .input-group .form-control,
    .input-group .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.875rem !important;
    }

    .input-group-lg .form-control,
    .input-group-lg .btn {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.9375rem !important;
    }

    /* Compact pagination */
    .pagination {
        margin-top: 0.5rem !important;
    }

    .page-link {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.8125rem !important;
    }

    /* Reduce badge sizes */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.15rem 0.35rem !important;
    }

    .badge-lg {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    /* Compact table cells */
    .table td,
    .table th {
        padding: 0.25rem !important;
        font-size: 0.875rem !important;
    }

    /* Reduce form spacing */
    .form-control,
    .form-select {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.875rem !important;
    }

    /* Compact modal */
    .modal-body {
        padding: 0.5rem !important;
    }

    .modal-header {
        padding: 0.5rem !important;
    }

    /* Adjust specific Material Kit components */
    .min-vh-85 {
        min-height: 40vh !important;
    }

    .min-vh-75 {
        min-height: 35vh !important;
    }

    /* Compact search bars */
    .search-container {
        padding: 0.35rem 0 !important;
    }

    /* Reduce text sizes globally */
    .text-sm {
        font-size: 0.75rem !important;
    }

    .text-xs {
        font-size: 0.65rem !important;
    }

    /* Compact nav items */
    .nav-link {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.875rem !important;
    }

    /* Reduce Material Icons size */
    .material-symbols-rounded {
        font-size: 1.125rem !important;
    }

    i.material-symbols-rounded.text-md {
        font-size: 1rem !important;
    }

    /* Compact navbar adjustments */
    .navbar-brand {
        font-size: 1rem !important;
    }

    /* Make scrollable content more visible */
    .overflow-auto {
        max-height: none !important;
    }
}

/* ===== BLOG CARDS COMPACT STYLING ===== */

/* Target blog cards specifically by their inline styles */
article.card.h-100.shadow-sm {
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e5e7eb !important;
}

article.card.h-100.shadow-sm:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* Blog post-card class from home.html */
.post-card {
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

.post-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.post-card-image {
    height: 50px !important;
}

.post-card-image .overlay {
    font-size: 1.25rem !important;
}

.post-card-content {
    padding: 0.75rem !important;
}

/* Force all blog card images to 50px in all blog templates */
article.card > div[style*="background: linear-gradient(135deg, #10b981, #059669)"] {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
}

/* Force blog card content padding */
article.card > div[style*="padding"] {
    padding: 0.75rem !important;
}

/* Compact mode toggle button styling */
.compact-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.compact-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.compact-toggle .material-symbols-rounded {
    font-size: 1.25rem;
}

/* Mobile adjustments for toggle button */
@media (max-width: 768px) {
    .compact-toggle {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 0.8125rem;
    }
}
