body {
    background: linear-gradient(180deg, #78a6c8 0%, #e6eef3 30%, #e6eef3 100%);
    min-height: 100vh;
}

/* Hero section styles */
.hero-section {
    padding: 2rem 0;
    padding-bottom: 0;
    color: #2c3e50;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    position: relative;
    overflow: hidden;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1.5rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
}

@media (max-width: 375px) {
    .hero-section {
        padding: 1.25rem 0;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0 0.75rem;
    }
}

/* Section styles */
.all-jobs-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 30px 0;
    padding: 2rem;
}

/* Left filter layout styles */
.job-search-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.filter-panel {
    flex: 0 0 300px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filter-panel .filter-section {
    margin-bottom: 1.5rem;
}

.filter-panel .filter-section:last-child {
    margin-bottom: 0;
}

.filter-panel .dropdown {
    width: 100%;
    margin-bottom: 1.5rem;
}

.filter-panel .input-group {
    margin-bottom: 1.5rem;
}

.filter-panel .filter-btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Job Count and Sort Styles */
.job-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.sort-by {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Job Listings */
.job-listings {
    flex: 1;
}

.job-listing {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-listing:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.job-listing:last-child {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .job-listing {
        padding: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .job-listing:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    /* Specific logo sizing for job listings */
    .job-listing .company-logo {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 400px) {
    .job-listing .company-logo {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 375px) {
    .job-listing .company-logo {
        width: 40px;
        height: 40px;
    }
}

/* Stack location and salary on mobile */
@media (max-width: 576px) {
    .job-listing .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .job-listing .salary-range {
        margin-top: 0.25rem;
        padding-left: 0.15rem;
    }

    .job-listing .location {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    .job-listing .location i,
    .job-listing .salary-range i {
        width: 1rem;
        text-align: center;
        color: #3172ae;
    }
}

@media (max-width: 375px) {
    .job-listing {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .job-listing .job-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-top: 0.5rem;
    }

    .job-listing .job-meta-item {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
        background: rgba(120, 166, 200, 0.1);
        border-radius: 4px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        min-height: 24px;
    }

    .job-listing .job-meta-item i {
        font-size: 0.75rem;
        color: #3172ae;
    }

    .job-listing .salary-range {
        padding-left: 0.1rem;
    }
}

.filter-panel .form-check.form-switch {
    padding-top: 0;
}

.filter-panel .clear-filters {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
    display: inline-block;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    padding: 10px 20px;
    border-radius: 20px;
    background: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.mobile-filter-btn:active {
    transform: translate(-50%, 1px);
    background: #0056b3;
}

@media (max-width: 375px) {
    .mobile-filter-btn {
        bottom: 12px;
        padding: 8px 16px;
        font-size: 0.85rem;
        min-width: 100px;
    }
}

.mobile-filter-btn:hover {
    background: #0056b3;
}

/* Bottom Sheet Styles */
.filter-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1040;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, border-radius 0.3s ease;
    height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: max(env(safe-area-inset-bottom, 16px), 16px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    overscroll-behavior: contain; /* Prevent scroll bleed */
}

/* When fully expanded, remove top border radius */
.filter-bottom-sheet.show {
    border-radius: 0;
}

/* Add a drag handle indicator */
.filter-bottom-sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
}

.filter-bottom-sheet.show {
    transform: translateY(0);
}

.bottom-sheet-header {
    padding: 24px 16px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    margin-bottom: 8px;
}

.bottom-sheet-header h5 {
    margin: 0;
    font-weight: 600;
}

.bottom-sheet-header .close-sheet {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
}

.bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.bottom-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .all-jobs-section {
        padding: 1rem;
        margin: 15px 0;
    }

    .job-search-container {
        flex-direction: column;
        margin-top: 1rem;
    }

    .job-search-container > .filter-panel {
        display: none;
    }

    .filter-bottom-sheet .filter-panel {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 1rem 1rem;
        height: calc(85vh - 69px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-bottom-sheet .filter-section {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .filter-bottom-sheet .input-group {
        margin-bottom: 12px;
    }

    .filter-bottom-sheet .dropdown {
        margin-bottom: 8px;
    }

    /* Style the filter buttons in mobile view */
    .filter-bottom-sheet .filter-btn {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        padding: 10px 14px;
        font-size: 0.9rem;
        transition: background-color 0.2s ease;
        margin-bottom: 4px;
    }

    @media (max-width: 375px) {
        .filter-bottom-sheet .filter-btn {
            padding: 8px 12px;
            font-size: 0.85rem;
        }

        .filter-bottom-sheet .filter-section {
            margin-bottom: 12px;
            padding-bottom: 8px;
        }

        .bottom-sheet-header {
            padding: 16px 12px 12px;
        }

        .bottom-sheet-header h5 {
            font-size: 1rem;
        }

        .all-jobs-section {
            padding: 0.75rem;
            margin: 10px 0;
        }

        .job-listings {
            padding-bottom: 70px;
        }
    }

    .filter-bottom-sheet .filter-btn:hover,
    .filter-bottom-sheet .filter-btn:focus {
        background: #e9ecef;
    }

    .filter-bottom-sheet .filter-btn.active {
        background: #e7f1ff;
        border-color: #b8daff;
        color: #0056b3;
    }

    /* Add some spacing between filter sections */
    .filter-bottom-sheet .filter-section {
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid #eee;
    }

    .filter-bottom-sheet .filter-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .filter-panel .dropdown {
        margin-bottom: 0.75rem;
    }

    /* Prevent body scroll when bottom sheet is open */
    body.bottom-sheet-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Add padding to job listings to prevent overlap with filter button */
    .job-listings {
        padding-bottom: 80px;
    }

    /* Ensure filter button stays above bottom sheet */
    .mobile-filter-btn {
        z-index: 1041;
    }
}

/* Maintain existing filter button styles while adjusting for left panel */
.filter-panel .filter-btn {
    text-align: left;
    justify-content: flex-start;
    display: flex;
    align-items: center;
}

.filter-panel .filter-btn i {
    width: 20px;
    text-align: center;
}
