/**
 * Destination Filter Styles
 * Clean, modern filtering interface for destination pages
 */

/* Filter Container */
.esim-duration-filter {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Filter Header */
.esim-filter-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

/* Duration Indicator */
.esim-duration-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    background: #e8f5e8;
    border: 1px solid #4ade80;
    border-radius: 8px;
    padding: 8px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #166534;
    animation: fadeInDown 0.3s ease-out;
}

.esim-duration-indicator .indicator-icon {
    font-size: 16px;
}

.esim-duration-indicator .indicator-text {
    font-weight: 500;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.esim-filter-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.esim-filter-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Filter Controls Container */
.esim-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    justify-content: center;
}

/* Days Selector */
.esim-days-selector {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.esim-days-selector label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.esim-days-input-group {
    display: flex;
    gap: 10px;
}

.esim-days-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.esim-days-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.esim-days-preset {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.esim-days-preset:hover {
    border-color: #9ca3af;
}

.esim-days-preset:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Plan Type Filter */
.esim-plan-type-filter {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
}

.esim-plan-type-filter label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.esim-type-buttons {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.esim-type-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.esim-type-btn:hover {
    color: #374151;
}

.esim-type-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.esim-type-hint {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

.esim-type-btn.active .esim-type-hint {
    color: #6b7280;
}

/* Clear Filters Button */
.esim-clear-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esim-clear-filters:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.esim-clear-filters svg {
    width: 16px;
    height: 16px;
}

/* Active Filters Display */
.esim-active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.esim-filter-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.esim-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.esim-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
}

.esim-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.esim-tag-remove:hover {
    background: #dbeafe;
}

.esim-tag-remove svg {
    width: 10px;
    height: 10px;
    stroke: #1e40af;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .esim-duration-filter {
        padding: 20px 16px;
        margin: 16px 0;
    }
    
    .esim-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .esim-days-selector,
    .esim-plan-type-filter {
        max-width: 100%;
    }
    
    .esim-days-input-group {
        flex-direction: column;
    }
    
    .esim-days-preset {
        width: 100%;
    }
    
    .esim-type-buttons {
        flex-direction: column;
    }
    
    .esim-type-btn {
        flex-direction: row;
        justify-content: center;
        gap: 6px;
    }
    
    .esim-clear-filters {
        width: 100%;
        justify-content: center;
    }
    
    .esim-active-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Integration with existing styles */
.esim-plans-grid {
    transition: opacity 0.3s ease;
}

.esim-plan-card {
    transition: all 0.2s ease;
    transform-origin: center;
}

/* Filtering animations work for both grid and list views */
.esim-plan-card[style*="opacity: 0"] {
    pointer-events: none;
}

/* Grid view specific filtering styles */
.esim-plans-grid[data-view="grid"] .esim-plan-card {
    transition: opacity 0.2s ease, transform 0.2s ease, margin 0.2s ease;
}

/* Simple filtering - works for both grid and list views */
.esim-plan-card.filtered-out {
    display: none !important;
}

/* Ultimate filter hiding - this WILL work */
.esim-plan-card.filtered-out {
    display: none !important;
}

/* Additional specificity for stubborn list view styles */
div.esim-plans-grid div.esim-plan-card.filtered-out,
.esim-plans-grid[data-view] .esim-plan-card.filtered-out,
body .esim-plans-grid .esim-plan-card.filtered-out {
    display: none !important;
}

/* If display: none doesn't work, use position absolute */
.esim-plan-card.filtered-out {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

/* Smooth transitions for showing cards */
.esim-plan-card {
    transition: opacity 0.2s ease;
}

/* Grid view maintains its layout naturally */
.esim-plans-grid[data-view="grid"] .esim-plan-card {
    transition: opacity 0.2s ease;
}

/* List view also collapses naturally with display: none */
.esim-plans-grid[data-view="list"] .esim-plan-card {
    transition: opacity 0.2s ease;
}

/* Smooth sorting integration */
.esim-plans-grid.sorting .esim-plan-card {
    pointer-events: none;
}

/* Loading state for filter operations */
.esim-plans-grid.filtering {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes filterFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.esim-plan-card[style*="opacity: 1"] {
    animation: filterFadeIn 0.2s ease;
}

/* No Results Message Enhancement */
#no-results-message {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin: 40px 0;
}

#no-results-message .esim-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

#no-results-message h3 {
    font-size: 20px;
    color: #1f2937;
    margin: 0 0 8px 0;
}

#no-results-message p {
    color: #6b7280;
    margin: 0 0 20px 0;
}

#reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reset-filters:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}