/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Main Layout Container */
.sauge-jobs-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    align-items: start;
}

/* Main Content Area */
.jobs-main-content {
    min-height: 500px;
}

/* Job Cards Grid */
.job-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

/* Sidebar Styles */
.jobs-sidebar {
    width: 300px;
    height: calc(100vh - 40px);
    position: sticky;
    top: 70px;
    /* Add margin-top to match the ad container height + its bottom margin */
    margin-top: 224px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input and Select Global Styles */
.sauge-jobs-container input,
.sauge-jobs-container select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background-color: white;
}

.sauge-jobs-container input:focus,
.sauge-jobs-container select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px #6366f1;
}

/* Fixed Filters Section */
.sidebar-filters {
    margin-bottom: 0;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters-title {
    font-size: 1.25rem;
    color: #0369a1;
    margin-bottom: 1rem;
    font-weight: 600;
}

.sidebar-filters > * {
    margin-bottom: 16px;
    width: 100%;
}

.sidebar-filters > *:last-child {
    margin-bottom: 0;
}

/* Search Container Styles */
.search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 12px 12px 12px 40px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-container input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.apply-filters {
    padding: 8px 16px;
    background: linear-gradient(135deg, #34d399 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-filters:hover {
    color: white;
}

/* Content Break */
.content-break {
    height: 1px;
    background: #e2e8f0;
    margin: 15px 0;
}

/* Job Card Styles */
.job-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 650px;
}

.card-content {
    flex: 1;
    margin-bottom: 60px;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.job-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.3;
}

.company-name {
    color: #64748b;
    font-size: 1rem !important;
}

/* Badges */
.badges-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.badge-primary {
    background-color: #eff6ff;
    color: #3b82f6;
}

.badge-secondary {
    background-color: #f1f5f9;
    color: #64748b;
}

.remote-badge {
    gap: 4px; /* Reduced from 6px */
    background-color: #5bc0be;
    color: #ffffff;
    border-radius: 4px; /* Reduced from 6px */
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;  /* Prevents text from wrapping */
    padding: 0.5rem 1rem;  /* Adjust padding as needed */
    min-width: fit-content;  /* Ensures the badge fits its content */
    font-size: 0.875rem;  /* Adjust font size if needed */
    line-height: 1;  /* Ensures proper vertical alignment */
}

/* Location */
.location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

.location i {
    color: #94a3b8;
    font-size: 16px;
}

/* Salary Section */
.salary-section {
    background: linear-gradient(to right, #f0fdf4, #f0f9ff);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.salary-amount {
    color: #1a365d;
    font-size: 17px;
    font-weight: 600;
}

.salary-icon {
    color: #0d9488;
    font-size: 18px;
}

/* Insights Section */
.insights-wrapper {
    background: linear-gradient(to right, #f8fafc, #f0f9ff);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.insights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.insights-header i {
    color: #6366f1;
    font-size: 16px;
}

.insights-header-text {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.insights-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent;
    padding: 0;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    color: #0f172a;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.section-label i {
    color: #0ea5e9;
    font-size: 14px;
}

.trends {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.salary-context {
    color: #64748b;
    font-size: 14px;
}

/* Demand Section */
.demand-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demand-text {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}

/* View Details Button */
.view-details {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    padding: 10px;
    /*background: linear-gradient(135deg, #34d399 0%, #3b82f6 100%);*/
    background: linear-gradient(135deg, #34d399 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-details:hover {
    background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
    color: #ffffff;
}

/* Utility Classes */
.truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Ad Container Base Styles */
.sauge-jobs-container .ad-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    position: relative;
    margin: 24px auto;
}

/* Top Banner and In-feed Ad Containers */
.sauge-jobs-container .jobs-main-content .ad-container-top {
    max-width: 1500px;
    width: 100%;
    grid-column: 1 / -1;
}

.sauge-jobs-container .jobs-main-content .ad-container-feed {
    max-width: 1500px;
    width: 100%;
    grid-column: 1 / -1;
}

/* Ad Placeholders for Top Banner and In-feed */
.sauge-jobs-container .jobs-main-content .ad-container-top .ad-placeholder,
.sauge-jobs-container .jobs-main-content .ad-container-feed .ad-placeholder {
    width: 100%;
    height: 90px;
    min-height: 90px;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Top Ad Specific Styles */
.sauge-jobs-container .ad-container-top {
    margin-bottom: 30px;
}

/* In-feed Ad Specific Styles */
.sauge-jobs-container .job-cards .ad-container-feed {
    margin: 24px auto;
}

/* Sidebar Ad Containers */
.sauge-jobs-container .jobs-sidebar .sidebar-ad {
    width: 100%;
    max-width: 300px;
}

.sauge-jobs-container .jobs-sidebar .sidebar-ad .ad-placeholder {
    width: 100%;
    height: 250px;
    min-height: 250px;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollable Ads Section */
.sauge-jobs-container .sidebar-ads {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Ad Label Styling */
.sauge-jobs-container .ad-container .ad-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ad Placeholder Text */
.sauge-jobs-container .ad-container .ad-placeholder-text {
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
}

/* Responsive Ad Styles */
@media (max-width: 1024px) {
    .sauge-jobs-container .jobs-main-content .ad-container-top,
    .sauge-jobs-container .jobs-main-content .ad-container-feed {
        width: 100%;
        max-width: 100%;
        margin: 24px 0;
    }

    .sauge-jobs-container .jobs-main-content .ad-container-top .ad-placeholder,
    .sauge-jobs-container .jobs-main-content .ad-container-feed .ad-placeholder {
        width: 100%;
    }

    .sauge-jobs-container .sidebar-ads {
        display: none;
    }
}

/* Mobile Search Bar */
.mobile-search-bar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
    transition: transform 0.3s ease;
    margin-top: 20px;
}

.mobile-search-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-search-input-wrapper {
    position: relative;
    flex: 1;
}

.mobile-search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Filter Button */
.filter-button {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e293b;
    position: relative;
    cursor: pointer;
}

.filter-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #3b82f6;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

/* Mobile Filters Drawer */
.filters-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.12);
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.filters-drawer.active {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 4px 4px 16px 4px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
}

.drawer-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.close-drawer {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-drawer:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* Filter Sections */
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

/* Filter Controls */
.filter-group {
    position: relative;
    width: 100%;
}

.filter-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 18px;
    pointer-events: none;
}

.filter-group select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    background-color: white;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2364748b' class='w-4 h-4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.filter-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Apply Filters Button */
.filters-drawer .apply-filters {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.filters-drawer .apply-filters:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

/* Active State Styles */
.filter-group select:active {
    background-color: #f8fafc;
}

/* Better Scrolling */
.filters-drawer {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.filters-drawer::-webkit-scrollbar {
    width: 6px;
}

.filters-drawer::-webkit-scrollbar-track {
    background: transparent;
}

.filters-drawer::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Option Styles */
.filter-group select option {
    padding: 12px;
    font-size: 15px;
}



/* Drawer Backdrop */
.drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.drawer-backdrop.active {
    opacity: 1;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.desktop-active-filters {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 56px;
}

/* Only show if there are filter tags */
.desktop-active-filters:empty {
    display: none;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    color: #1e293b;
}

.filter-tag i {
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

.loading-spinner i {
    color: #3b82f6;
}

.loading .loading-spinner {
    display: flex;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 48px 20px;
    color: #64748b;
    background: white;
    border-radius: 12px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #94a3b8;
}

.no-results p {
    font-size: 18px;
    line-height: 1.5;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 24px;
    color: #ef4444;
    background: #fef2f2;
    border-radius: 8px;
    margin: 20px 0;
}

/* Load More Button */
.load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px auto;
    padding: 12px 32px;
    background: linear-gradient(135deg, #34d399 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more:hover {
    background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
    color: white;
}

.load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.load-more i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.load-more:hover i {
    transform: translateY(2px);
}

/* Update existing media query for tablets */
@media (max-width: 1024px) {
    .mobile-search-bar {
        display: block;
    }

    .jobs-main-content {
        margin-top: 60px;
    }

    .job-cards {
        grid-template-columns: 1fr;
    }

    .desktop-active-filters {
        display: none;
    }
}

/* Tablet-specific media query */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Restore sidebar and its contents */
    .jobs-sidebar {
        display: flex !important;
        width: 300px;
        margin-top: 174px;
    }

    /* Ensure sidebar filters are visible */
    .sidebar-filters {
        display: block !important;
    }

    /* Restore grid layout for tablet */
    .sauge-jobs-container {
        grid-template-columns: 1fr 300px;
        gap: 20px;
        padding: 20px;
    }

    /* Hide mobile-specific elements */
    .mobile-search-bar,
    .filters-drawer,
    .drawer-backdrop,
    .filter-button,
    #showFilters,
    #mobileActiveFilters {
        display: none !important;
    }

    /* Ensure ads are visible */
    .sidebar-ads {
        display: flex !important;
    }

    /* Adjust job cards for better tablet display */
    .job-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Reset main content margin since we're hiding mobile search */
    .jobs-main-content {
        margin-top: 0;
    }
}

/* Update mobile styles to be more specific */
@media (max-width: 767px) {
    .jobs-sidebar {
        display: none !important;
    }

    .sauge-jobs-container {
        grid-template-columns: 1fr;
    }

    .mobile-search-bar {
        display: block;
    }

    .filters-drawer,
    .drawer-backdrop {
        display: block;
    }
}

/* Cache Notice */
.cache-notice {
    font-size: 0.8rem;
    color: #64748b;
    text-align: right;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

/* Disclaimer Styles */
.disclaimer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 8px;
    vertical-align: middle;
}

.disclaimer-icon:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.disclaimer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.disclaimer-modal.active {
    display: flex;
}

.disclaimer-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.disclaimer-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.disclaimer-section {
    margin-bottom: 1.5rem;
}

.disclaimer-section-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.disclaimer-text {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.disclaimer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.disclaimer-close:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .disclaimer-content {
        width: 90%;
        padding: 1rem;
        max-height: 80vh;
        overflow-y: auto;
    }

    .disclaimer-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }

    .disclaimer-section {
        margin-bottom: 1rem;
    }

    .disclaimer-section-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .disclaimer-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .disclaimer-text ul {
        margin-top: 0.25rem;
        margin-left: 0.75rem;
    }

    .disclaimer-text li {
        margin-bottom: 0.25rem;
        font-size: 0.8rem;
    }

    .disclaimer-close {
        top: 0.5rem;
        right: 0.7rem;
        font-size: 1.1rem;
        padding: 0.25rem;
    }

}