/**
 * Shared Filter Styles
 * Common CSS for filter components used across pages
 * 
 * Usage: <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/shared-filters.css">
 */

/* ===================================
   Filter Card Container
   =================================== */
.filter-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
}

.filter-card-dark {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* ===================================
   Form Controls
   =================================== */
.filter-select {
    border: none;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #212529;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.filter-input {
    border: none;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #212529;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.filter-input:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.filter-input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

/* Secondary filter style (with border) */
.filter-select-secondary {
    background-color: #fff;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-select-secondary:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* ===================================
   Filter Labels
   =================================== */
.filter-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-align: left;
}

.filter-label i {
    margin-right: 0.25rem;
}

/* ===================================
   Hover & Transition Effects
   =================================== */
.hover-shadow-lg {
    transition: all 0.3s ease;
}

.hover-shadow-lg:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* ===================================
   Text Truncation
   =================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================
   Badge Styles
   =================================== */
.filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50rem;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.filter-badge-active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.filter-badge:hover {
    background-color: #e9ecef;
    cursor: pointer;
}

.filter-badge-active:hover {
    background-color: #0b5ed7;
}

/* ===================================
   Results Header
   =================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 768px) {
    .filter-card {
        padding: 1rem;
        border-radius: 0.75rem;
    }
    
    .filter-label {
        font-size: 0.65rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===================================
   TomSelect Custom Styles (Premium)
   =================================== */

/* Base Control */
.ts-control {
    border: none !important;
    background-color: transparent !important;
    padding: 0.75rem 0.5rem !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    color: var(--text, #212529) !important;
    font-size: 1rem !important;
}

.ts-control input {
    font-weight: 600 !important;
    color: var(--text, #212529) !important;
}

/* Dropdown Menu */
.ts-dropdown {
    border: none !important;
    border-radius: var(--radius, 0.5rem) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
    margin-top: 0.5rem !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.ts-dropdown-content {
    padding: 0.5rem !important;
}

.ts-dropdown .option {
    padding: 0.75rem 1rem !important;
    border-radius: 0.375rem !important;
    margin-bottom: 2px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.ts-dropdown .option.active,
.ts-dropdown .option:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    color: #0d6efd !important;
    font-weight: 600 !important;
}

/* Dropdown Arrow */
.ts-wrapper.single .ts-control:after {
    border-color: #94a3b8 transparent transparent transparent !important;
    border-width: 6px 6px 0 6px !important;
}

/* Focus State */
.ts-wrapper.focus .ts-control {
    box-shadow: none !important;
}

/* Input Group Integration */
.input-group > .ts-wrapper {
    flex: 1 1 auto;
    width: 1%;
    margin-bottom: 0;
}

.input-group > .ts-wrapper > .ts-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* With Light Background */
.ts-wrapper.bg-light .ts-control {
    background-color: #f8f9fa !important;
    border-radius: 0.5rem !important;
}

.ts-wrapper.bg-light.focus .ts-control {
    background-color: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
}

/* Clear Button Plugin */
.ts-wrapper .clear-button {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.ts-wrapper:hover .clear-button {
    opacity: 1;
}
