/* 
 * Shared List Pages CSS
 * Common styles for job_list and tender_list pages
 * Optimized for performance
 */

/* ========================================
   CLS PREVENTION - CRITICAL LAYOUT STABILITY
   ======================================== */
.header-nav {
    min-height: 70px;
}

.hero-section,
.hero-content,
.job-list-header {
    min-height: 320px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.cursor-pointer {
    cursor: pointer;
}

.filter-actions {
    margin-top: 1rem;
}

.btn-no-decoration,
.btn-no-decoration:hover,
.btn-no-decoration:focus {
    text-decoration: none !important;
}

/* City Row Filter */
.city-row-filter {
    margin-bottom: 2em;
}

.city-row-filter > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}

/* Organization Name Text */
.org-name-text {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748B;
    font-weight: 500;
}

/* Filter Label Icons */
.filter-label-icon-tag {
    color: #1D4ED8;
}

.filter-label-icon-location {
    color: #EF4444;
}

/* ========================================
   SHARED STATS CONTAINER (Base Styles)
   ======================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 0 auto;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    display: block;
}

.stat-card-link:hover {
    transform: translateY(-4px);
    text-decoration: none;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-width: 160px;
}

.stat-card-link:hover .stat-card {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    transition: color 0.2s ease;
}

.stat-card-link:hover .stat-number {
    color: #4F9CF9;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: center;
    transition: color 0.2s ease;
}

.stat-card-link:hover .stat-label {
    color: #64748B;
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .stat-card {
        padding: 1rem 1.5rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
}

/* ========================================
   GLOBAL LINK STYLES
   ======================================== */
a,
a:hover,
a:focus,
a:active,
button,
button:hover,
button:focus {
    text-decoration: none !important;
}

/* ========================================
   CONTENT CONTAINER
   ======================================== */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

@media (max-width: 768px) {
    .content-container {
        padding: 2rem 1rem;
    }
}

/* ========================================
   SEARCH & FILTER SECTION
   ======================================== */
.search-filter-section {
    background: #FFFFFF;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #E2E8F0;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: stretch;
}

.search-input {
    flex: 2;
    padding: 0.75rem 1.25rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #FFFFFF;
    transition: border-color 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: #64748B;
}

.search-city-select {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 2rem 0.75rem 0.875rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #FFFFFF;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    direction: rtl;
    text-align: right;
}

.search-city-select:focus {
    outline: none;
    border-color: #4F9CF9;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: #4F9CF9;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.search-btn:hover {
    background: #3B82F6;
}

.advanced-toggle {
    padding: 0.75rem 1.5rem;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    color: #64748B;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-toggle:hover {
    background: #F9FAFB;
    border-color: #94A3B8;
    color: #475569;
}

/* ========================================
   ADVANCED FILTERS
   ======================================== */
.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: block;
}

.filter-scroll-box {
    max-height: 240px;
    overflow-y: auto;
    background: #F9FAFB;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.filter-scroll-box::-webkit-scrollbar {
    width: 6px;
}

.filter-scroll-box::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}

.filter-scroll-box::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

.filter-scroll-box::-webkit-scrollbar-thumb:hover {
    background-color: #94A3B8;
}

.filter-option {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.15s ease;
}

.filter-option:hover {
    background: #FFFFFF;
}

.filter-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.625rem;
    direction: rtl;
    width: 100%;
}

.filter-option label span {
    flex: 1;
    color: #0F172A;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.filter-option label i {
    flex-shrink: 0;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid #D1D5DB;
    border-radius: 0.25rem;
    cursor: pointer;
    accent-color: #4F9CF9;
}

.filter-option i {
    margin-left: 0.625rem;
    font-size: 0.875rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    background: #FFFFFF;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.filter-select:hover {
    border-color: #9CA3AF;
}

.filter-select:focus {
    outline: none;
    border-color: #64748B;
}

.btn-outline-primary {
    padding: 0.75rem 1.5rem;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-outline-primary:hover {
    background: #F9FAFB;
    border-color: #94A3B8;
    color: #1E293B;
}

.btn-outline-danger {
    padding: 0.75rem 1.5rem;
    background: #FFFFFF;
    border: 1px solid #DC2626;
    border-radius: 0.5rem;
    color: #DC2626;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-danger:hover {
    background: #DC2626 !important;
    color: white !important;
    border-color: #DC2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 2px 0 rgba(220, 38, 38, 0.2);
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ========================================
   CITY FILTER BOXES
   ======================================== */
.city-filter-boxes,
.city-row-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0;
}

.city-filter-box,
.city-box {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: #F9FAFB;
    color: #64748B;
    text-decoration: none;
    border: 1px solid #E5E7EB;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.city-filter-box:hover,
.city-box:hover {
    background: #F3F4F6;
    border-color: #CBD5E1;
    color: #475569;
}

.city-filter-box.active,
.city-box.active {
    background: #4F9CF9;
    color: #FFFFFF;
    border-color: #4F9CF9;
}

/* ========================================
   RESULTS HEADER
   ======================================== */
.results-header {
    margin-bottom: 1.5rem;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: #64748B;
    font-weight: 500;
}

.results-count i {
    color: #4F9CF9;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    background: #FFFFFF;
    padding: 5rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.empty-state i {
    font-size: 3rem;
    color: #9CA3AF;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #0F172A;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: #64748B;
    margin-bottom: 1.5rem;
}

.btn-view {
    padding: 0.75rem 1.5rem;
    background: #4F9CF9;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.btn-view:hover {
    background: #3B82F6;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    gap: 0.5rem;
}

.pagination .page-item .page-link {
    border: 1px solid #E2E8F0;
    color: #64748B;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pagination .page-item .page-link:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
}

.pagination .page-item.active .page-link {
    background: #4F9CF9;
    border-color: #4F9CF9;
    color: white;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SEARCH INPUT WITH ICON WRAPPER
   ======================================== */
.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #9CA3AF;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.search-input-wrapper:focus-within i {
    color: #4F9CF9;
}

.search-input-wrapper + .search-input,
.search-input-wrapper .search-input {
    width: 100%;
    padding-left: 2.75rem;
}

/* Filter Select with Icon Wrapper */
.filter-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
    flex-shrink: 0;
}

.filter-select-wrapper i {
    position: absolute;
    left: 1rem;
    color: #9CA3AF;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.filter-select-wrapper:focus-within i {
    color: #4F9CF9;
}

.filter-select-wrapper .filter-select {
    padding-left: 2.75rem;
}

/* Clear/Reset Button */
.clear-btn {
    padding: 0.875rem 1.5rem;
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    color: #6B7280;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.clear-btn:hover {
    background: #F9FAFB;
    border-color: #EF4444;
    color: #EF4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.clear-btn:active {
    transform: translateY(0);
}

.clear-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .search-input-wrapper {
        min-width: 100%;
    }

    .filter-select-wrapper {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .search-filter-section {
        padding: 1rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input-wrapper,
    .filter-select-wrapper {
        width: 100%;
        min-width: 100%;
    }
    
    .search-input,
    .search-city-select,
    .filter-select {
        flex: 1;
        width: 100%;
    }
    
    .search-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .advanced-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .city-filter-box,
    .city-box {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
        margin: 0 0.125rem 0.25rem 0;
        border-radius: 0.375rem;
        line-height: 1.2;
    }
    
    .city-row-filter > div {
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .search-btn span,
    .clear-btn span {
        display: none;
    }

    .search-btn,
    .clear-btn {
        padding: 0.875rem;
        min-width: 48px;
    }

    .search-btn i,
    .clear-btn i {
        margin: 0;
    }
}

