/* search/static/css/jobs_futuristic.css */

:root {
    /* Color palette - Consolidated for clarity and usage */
    --primary-color: #010080;
    --primary-color-rgb: 1, 0, 128;
    --primary-color-light: #0100801f; /* Added: Used for meta grid bg, job title link bg */

    --secondary-color: #212121; /* This is like --text-color-primary from old setup */
    /* --light-color: #ffffff; */
    --light-gray-bg: #f4f7fc; /* Main page background (body) */

    --border-color: #dbe3f0; /* General border color (e.g., inputs, sidebar divisions) */
    --border-color-pro: #e9ecef; /* Added: Specific border for job cards and header elements */

    --text-color: #1a1a2e; /* Primary text color (dark) */
    --text-muted: #6c7a8f; /* Muted/secondary text color */
    --text-color-subtle: #777; /* Added: For very subtle text, like labels in meta boxes */

    --success-color: #00b894;
    --danger-color: #dc3545; /* Added: Used for location icon */
    --warning-color: #ffc107; /* Added: Used for salary icon */

    /* Card Specific Backgrounds (aligned with previous discussions) */
    --card-bg: #F7F7F7; /* Your chosen off-white/silver for job cards & filter pod content */
    --card-secondary-bg: #f8f9fa; /* For inner card elements like company name chip, meta boxes */


    /* Sizing & Radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;

    /* Spacing */
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;

    /* Shadows & Glow */
    --shadow-sm: 0 4px 10px rgba(var(--primary-color-rgb), 0.05);
    --shadow-md: 0 8px 25px rgba(var(--primary-color-rgb), 0.1);
    --glow-focus: 0 0 10px rgba(var(--primary-color-rgb), 0.3);
    /* Keep job card specific shadow as a separate var or merge if appropriate */
    --card-shadow-pro:
      0 2.8px 2.2px rgba(0, 0, 0, 0.02),
      0 6.7px 5.3px rgba(0, 0, 0, 0.028),
      0 12.5px 10px rgba(0, 0, 0, 0.035),
      0 22.3px 17.9px rgba(0, 0, 0, 0.042),
      0 41.8px 33.4px rgba(0, 0, 0, 0.05),
      0 100px 80px rgba(0, 0, 0, 0.07);


    /* Transitions */
    --transition-fast: 0.2s ease-out;
    --transition-smooth: 0.3s ease-in-out;

    /* Font Family - Ensure Inter is imported somewhere or defined here */
    --font-family-pro: "Inter", sans-serif;
    --font-family: "Montserrat", sans-serif; /* Assuming this is your general font */
    --font-color: #212121; /* Generic font color, if different from --text-color */
}

/* Base Styles */
body {
    background-color: var(--light-gray-bg);
    color: var(--text-color);
    font-family: var(--font-family); /* Apply a default font */
}
.mt-3 { margin-top: var(--space-3) !important; }

/* Main Search Container */
.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-4);
}

.search-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-4);
    align-items: flex-start;
}

/* =================================== */
/* Sidebar Filters (Desktop)         */
/* =================================== */
.sidebar-filters {
    background: var(--light-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    /* REMOVED: position: sticky; */ /* This often interacts with overflow in unexpected ways for internal scrolling */
    /* REMOVED: top: var(--space-4); */
    /* REMOVED: max-height: calc(100vh - 2 * var(--space-4)); */ /* Let it grow naturally */
    font-family: var(--font-family-pro);
}

.sidebar-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.sidebar-close-btn { display: none; } /* Hidden on desktop */

.sidebar-content {
    padding: var(--space-4);
    /* REMOVED: overflow-y: auto; */ /* Key change for desktop, let content push parent */
    flex-grow: 1;
}
.filters-form{
    width: 100%;
}
.filter-pod {
    margin-bottom: var(--space-4);
}
.filter-pod:last-child { margin-bottom: 0; }

/* --- Filter Pod Collapsible Sections - CONSOLIDATED & CORRECTED --- */
.pod-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.pod-title:hover {
    background-color: var(--light-gray-bg);
}

.pod-title i:first-child {
    margin-right: var(--space-2);
    color: var(--primary-color);
    font-size: 1.3rem;
}

.pod-title .toggle-icon {
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

.pod-title.is-expanded .toggle-icon {
    transform: rotate(180deg);
}

.filter-pod .pod-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 20px;
}

.filter-pod .pod-content.is-expanded {
    /* max-height: 500px; */ /* This fixed max-height is only a transition target.
                               JS sets it dynamically to scrollHeight, then 'none'.
                               Keeping it large as a fallback is okay, but not strictly needed if JS is robust. */
    padding: 0;
}

/* Ensure the checkbox/radio groups also have some spacing inside the pod-content */
.filter-pod .pod-content .checkbox-group,
.filter-pod .pod-content .radio-group {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Styles for labels and inputs within filter pods */
.filter-pod .pod-content .form-label-futuristic {
    margin:15px 0 10px 0 !important;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.filter-pod .pod-content .form-label-futuristic:first-of-type {
    margin-top: 0;
}

.filter-pod .pod-content .form-control-futuristic,
.filter-pod .pod-content .form-select-futuristic {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--light-color);
    margin-top: 5px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-pod .pod-content .form-control-futuristic::placeholder {
    color: var(--text-muted);
}

/* --- Salary Slider --- */
.salary-slider-wrapper { margin-top: var(--space-2); }
.salary-value-display {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
    text-align: center;
}
.salary-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color-light));
    outline: none;
    border-radius: 3px;
    cursor: pointer;
}
.salary-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--light-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.salary-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--light-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.salary-slider:active::-webkit-slider-thumb { transform: scale(1.15); }
.salary-slider:active::-moz-range-thumb { transform: scale(1.15); }

/* --- Checkbox & Radio Groups --- */
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: 12px; }
.checkbox-item, .radio-item { display: flex; align-items: center; }
.checkbox-item input, .radio-item input {
    margin-right: 10px;
    accent-color: var(--primary-color);
    width: 18px; height: 18px;
}
.checkbox-item label, .radio-item label {
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-color);
}

/* --- Sidebar Buttons --- */
.sidebar-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-2);
}

.btn-reset, .btn-apply {
    flex-grow: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-reset .bi, .btn-apply .bi { margin-right: var(--space-2); }
.btn-reset {
    background-color: var(--light-gray-bg);
    color: var(--text-muted);
    border-color: var(--border-color);
}
.btn-reset:hover { background-color: #e9eef5; color: var(--text-color); }
.btn-apply {
    background-color: var(--primary-color);
    color: var(--light-color);
}
.btn-apply:hover {
    background-color: #01006D;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =================================== */
/* Main Content Area (from your file) */
/* =================================== */
.core-search-bar {
    display: flex;
    gap: var(--space-3);
    background-color: var(--light-color);
    padding: var(--space-3);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-4);
}
.input-field-futuristic {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.input-field-futuristic .bi {
    position: absolute;
    left: 15px;
    font-size: 1.3rem;
    color: var(--text-muted);
    pointer-events: none;
}
.input-field-futuristic input[type="text"] {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    color: var(--text-color);
    transition: var(--transition-smooth);
}
.input-field-futuristic input[type="text"]::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}
.input-field-futuristic input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--glow-focus);
}
.btn-launch-search {
    background-image: linear-gradient(45deg, var(--primary-color), #003f9e);
    color: var(--light-color);
    border: none;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-launch-search .bi { margin-right: 8px; font-size: 1.3rem; }
.btn-launch-search:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.3); }

/* Placeholder results styles */
.hero-subtitle-futuristic { font-size: 1.1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--space-4);}
.highlight-count { color: var(--primary-color); font-weight: 700; }
.placeholder-card {
    background: var(--light-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    height: 120px;
    margin-bottom: var(--space-3);
    border: 1px solid var(--border-color);
}

/* =================================== */
/* Mobile & Responsive Design        */
/* =================================== */
/* Mobile Header is fine as is */
.mobile-header { display: none; } /* Hidden on desktop */
.sidebar-backdrop { display: none; } /* Hidden on desktop */

@media(max-width: 1366px){
    aside .card,
    .sidebar-list{
        padding: 10px !important;
    }

    .sidebar-list li a{
        padding:10px 3px 0 !important;
    }
}

@media (max-width: 991.98px) { /* Changed to 991.98px for common Bootstrap breakpoint */
    .search-grid {
      grid-template-columns: 1fr;
    }

    /* --- Mobile Header --- */
    .mobile-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: var(--space-4);
    }
    .mobile-header-title {
        font-size: 1.5rem;
        margin: 0;
        color: var(--text-color);
    }
    .mobile-filter-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--light-color);
      border: 1px solid var(--border-color);
      padding: 10px 16px;
      border-radius: var(--border-radius-md);
      font-size: 1rem;
      font-weight: 500;
      cursor: pointer;
      box-shadow: var(--shadow-sm);
    }
    .filter-count-badge {
        background-color: var(--primary-color);
        color: var(--light-color);
        width: 24px;
        height: 24px;
        border-radius: 50%;
        font-size: 0.8rem;
        font-weight: 700;
        display: none; /* Hidden by default */
        align-items: center;
        justify-content: center;
    }

    /* --- Mobile Sidebar (Slide-in Panel) --- */
    .sidebar-filters {
      position: fixed;
      top: 0;
      left: -320px; /* Match width for full hide */
      width: 320px;
      height: 100%; /* Fill full height of viewport */
      z-index: 1100;
      transform: translateX(0); /* Default position without active class */
      transition: transform var(--transition-smooth);
      box-shadow: 0 0 40px rgba(0,0,0,0.2);
      border-radius: 0;
      /* REINTRODUCE overflow-y for mobile */
      overflow-y: auto; /* Allow internal scrolling only on mobile fixed sidebar */
    }
    .sidebar-filters.is-open {
      transform: translateX(320px); /* Slide in by its own width */
      left: 0; /* Ensures it starts from 0 */
    }
    .sidebar-header {
        border-radius: 0;
    }
    .sidebar-close-btn {
      display: block;
      background: none;
      border: none;
      font-size: 1.5rem;
      color: var(--text-muted);
      cursor: pointer;
    }

    /* --- Backdrop --- */
    .sidebar-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.4);
      z-index: 1050;
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--transition-smooth);
    }
    .sidebar-backdrop.is-active {
      opacity: 1;
      pointer-events: auto;
    }

    /* --- Main content adjustments on mobile --- */
    .core-search-bar { flex-direction: column; }
    .btn-launch-search span { display: inline; }
}