/* =========================================
   listings.css
   Jobs + Internships browse pages and
   single job/internship detail pages.
   Includes: search bar, filter sidebar,
   job cards, result header, pagination,
   single-job layout, apply buttons,
   company info sidebar, share buttons.
   Depends on: global.css, components.css
========================================= */

/* =========================================
   BROWSE PAGE CONTAINER
========================================= */
.browse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.jobs-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* =========================================
   TOP SEARCH BAR
========================================= */
.search-bar {
    background: white;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    gap: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.search-btn {
    padding: 0 24px;
    background: #0066ff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

/* =========================================
   RESULTS HEADER
========================================= */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 4px;
}

.results-count { font-size: 0.95rem; color: #475569; font-weight: 600; }

.sort-select {
    padding: 10px 40px 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.sort-select:hover,
.sort-select:focus {
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

/* =========================================
   JOB CARDS (browse list)
========================================= */
.jobs-grid { display: flex; flex-direction: column; gap: 16px; }

.job-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

.job-card:hover {
    border-color: #0066ff;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.job-header { display: flex; gap: 16px; margin-bottom: 16px; }

/* Browse page company logo (smaller variant) */
.job-card .company-logo {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: #0066ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.job-title    { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.company-name { color: #64748b; font-size: 0.9rem; }

.job-meta {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0;
}

.job-meta i { color: #94a3b8; margin-right: 6px; }

.job-footer {
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

/* =========================================
   FILTERS SIDEBAR
========================================= */
.filters-sidebar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.filters-sidebar::-webkit-scrollbar       { width: 5px; }
.filters-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-header h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; margin: 0; }

.clear-all       { font-size: 0.85rem; color: #0066ff; text-decoration: none; font-weight: 600; transition: 0.2s; }
.clear-all:hover { text-decoration: underline; }

.filter-section          { margin-bottom: 24px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section h4       { font-size: 0.95rem; font-weight: 600; color: #1e293b; margin-bottom: 12px; }

.filter-options { display: flex; flex-direction: column; gap: 12px; }

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s;
}

.filter-option:hover { color: #0066ff; }

.filter-option input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: #0066ff;
    margin: 0;
}

/* Show / hide extra options */
.hidden-filter { display: none !important; }

.show-more-filters {
    background: none;
    border: none;
    color: #0066ff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 8px;
    transition: 0.2s;
}

.show-more-filters:hover { text-decoration: underline; }

/* =========================================
   LOAD MORE BUTTON
========================================= */
.load-more-jobs {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 30px auto;
    background: #f8fafc;
    color: #0066ff;
    border: 1px solid #cbd5e1;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-jobs:hover {
    background: #eff6ff;
    border-color: #0066ff;
    transform: translateY(-2px);
}

/* =========================================
   MOBILE FILTER BUTTON (inline style)
========================================= */
.mobile-filter-btn {
    display: none;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: 0 0 15px 0 !important;
    cursor: pointer;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    transition: 0.2s;
    transform: none !important;
    left: auto !important;
    height: auto !important;
}

.mobile-filter-btn:hover,
.mobile-filter-btn:active {
    background: #f8fbff !important;
    border-color: #0066ff !important;
    color: #0066ff !important;
}

/* =========================================
   FILTER OVERLAY (mobile drawer backdrop)
========================================= */
.filter-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-overlay.active { display: block !important; opacity: 1; }

.mobile-close-filter { display: none; }

/* =========================================
   SINGLE JOB / INTERNSHIP DETAIL PAGE
========================================= */
.job-details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 30px;
    align-items: start;
}

.main-content,
.sidebar-right { min-width: 0; }

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
    transition: 0.2s;
}

.back-button:hover { color: #0066ff; }

.job-header-card,
.job-section,
.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
}

/* =========================================
   COMPANY BANNER (job detail header)
========================================= */
.company-banner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.company-logo-large {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.job-title-section h1    { font-size: 1.8rem; margin: 0 0 8px; color: #0f172a; }
.company-name-text       { font-size: 1.1rem; color: #64748b; margin-bottom: 16px; }
.company-name-text i     { color: #0066ff; margin-right: 6px; }

.job-meta-top { display: flex; flex-wrap: wrap; gap: 20px; }

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 500;
}

.meta-item i { color: #0066ff; }

/* =========================================
   JOB STATS BAR
========================================= */
.job-stats {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.stat-badge         { display: flex; align-items: center; gap: 8px; color: #475569; font-size: 0.9rem; font-weight: 500; }
.stat-badge i       { color: #0066ff; }
.stat-badge.deadline      { color: #dc2626; font-weight: 600; }
.stat-badge.deadline i    { color: #dc2626; }

/* =========================================
   APPLY BUTTONS
========================================= */
.action-buttons { display: flex; gap: 16px; }

.btn-apply-large {
    flex: 1;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-apply-large:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,102,255,0.2); }
.btn-apply-large.disabled-btn         { background: #94a3b8; cursor: not-allowed; }
.btn-apply-large.warning-btn          { background: #f59e0b; }
.btn-apply-large.success-btn          { background: #16a34a; cursor: not-allowed; }

/* =========================================
   JOB DESCRIPTION & SKILLS
========================================= */
.job-description { color: #475569; line-height: 1.7; font-size: 1rem; }

.skills-container { display: flex; flex-wrap: wrap; gap: 12px; }

.skill-tag {
    background: #eff6ff;
    color: #0066ff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* =========================================
   RIGHT SIDEBAR (company info)
========================================= */
.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.company-info-item { display: flex; gap: 16px; margin-bottom: 16px; align-items: center; }

.company-info-icon {
    width: 44px; height: 44px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0066ff;
    font-size: 1.1rem;
}

.company-info-text h4 { font-size: 0.95rem; margin: 0 0 4px; color: #0f172a; }
.company-info-text p  { margin: 0; color: #64748b; font-size: 0.85rem; }

/* =========================================
   SHARE BUTTONS
========================================= */
.share-buttons { display: flex; gap: 12px; justify-content: center; }

.share-buttons button {
    color: white;
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
}

.share-buttons button:hover { transform: scale(1.1); }

/* =========================================
   MOBILE BREAKPOINTS
========================================= */
@media (max-width: 900px) {
    /* Convert filter sidebar to slide-out drawer */
    .mobile-filter-btn { display: flex !important; order: -1 !important; }

    .results-header {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 15px 0 !important;
        margin-bottom: 20px !important;
    }

    .results-count { width: auto !important; order: 1 !important; margin-bottom: 0 !important; }
    .sort-select   { width: auto !important; flex: none !important; order: 2 !important; height: 42px !important; margin: 0 !important; }

    .browse-container { display: block !important; padding: 20px !important; }

    .filters-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 300px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 10001 !important;
        background: #fff !important;
        border-radius: 0 !important;
        transition: left 0.3s ease !important;
        padding: 30px 24px 80px 24px !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1) !important;
        margin: 0 !important;
        overflow-y: auto !important;
    }

    .filters-sidebar.active { left: 0 !important; }

    .mobile-close-filter {
        display: block !important;
        position: absolute !important;
        top: 15px !important; right: 20px !important;
        background: none !important;
        border: none !important;
        font-size: 1.5rem !important;
        color: #64748b !important;
        cursor: pointer !important;
        z-index: 10002 !important;
    }

    /* Job detail page */
    .job-details-container { grid-template-columns: 1fr; }
    .company-banner        { flex-direction: column; align-items: center; text-align: center; }
    .job-meta-top, .job-stats { justify-content: center; }
}

@media (max-width: 768px) {
    /* Search bar */
    .search-bar    { flex-direction: column !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; gap: 12px !important; width: 100% !important; }
    .search-input  { width: 100% !important; padding: 14px 16px !important; border-radius: 12px !important; box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important; border: 1px solid #fff !important; }
    .search-btn    { width: 100% !important; border-radius: 12px !important; padding: 14px !important; box-shadow: 0 6px 15px rgba(0,102,255,0.25) !important; font-size: 16px !important; }

    /* Job detail */
    .job-details-container { padding: 20px 15px !important; }
    .job-header-card,
    .job-section,
    .sidebar-card          { padding: 20px !important; }
    .job-title-section h1  { font-size: 1.35rem !important; line-height: 1.4 !important; }
    .company-name-text     { font-size: 0.95rem !important; }
    .job-meta-top          { justify-content: center !important; gap: 12px !important; }
    .meta-item             { font-size: 0.85rem !important; }
    .job-stats             { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; padding: 15px !important; }
    .action-buttons        { flex-direction: column !important; gap: 10px !important; }
    .btn-apply-large       { width: 100% !important; padding: 14px !important; font-size: 0.95rem !important; }

    .job-details-container .job-section h2,
    .job-details-container .job-section h3 { font-size: 1.1rem !important; margin-bottom: 15px !important; padding-bottom: 10px !important; }

    .job-description { font-size: 0.95rem !important; line-height: 1.6 !important; }

    /* Filter chips */
    .filter-chips { gap: 8px !important; margin-top: 20px !important; }
    .chip         { padding: 8px 14px !important; font-size: 12px !important; }
}