/**
 * Gallery State & Filter Styles
 * Search tags, filter chips, and state UI
 * 
 * @package Fotografiescu
 * @version 1.0.0
 */

/* ========================================
   SEARCH TAGS CONTAINER
   ======================================== */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--color-primary, #3b82f6);
    background: rgba(255, 255, 255, 0.08);
}

.search-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--color-primary, #3b82f6);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    animation: tagAppear 0.2s ease;
}

@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.search-input {
    flex: 1;
    min-width: 100px;
    padding: 4px 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.search-clear.hidden {
    display: none;
}

/* ========================================
   FILTER CHIPS
   ======================================== */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.filter-chip.active {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: white;
}

.filter-chip .chip-count {
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 11px;
}

.filter-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Color chips */
.filter-chip[data-color] {
    padding-left: 8px;
}

.filter-chip .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Status chips */
.status-chips {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.status-chip {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-chip:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.status-chip.active {
    color: white;
    background: var(--color-primary, #3b82f6);
}

/* Orientation chips */
.orientation-chips {
    display: flex;
    gap: 8px;
}

.orientation-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.orientation-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.orientation-chip.active {
    background: var(--color-primary-10, rgba(59, 130, 246, 0.1));
    border-color: var(--color-primary, #3b82f6);
    color: var(--color-primary, #3b82f6);
}

.orientation-chip svg {
    width: 24px;
    height: 24px;
}

.orientation-chip .chip-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   KEYWORDS BAR ENHANCEMENTS
   ======================================== */

.keywords-bar {
    position: relative;
    overflow: hidden;
}

.keywords-track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
}

.keywords-track::-webkit-scrollbar {
    display: none;
}

.keyword-chip,
.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.keyword-chip:hover,
.keyword-tag:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-1px);
}

.keyword-chip.active,
.keyword-tag.active {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: white;
}

/* Keywords bar fade edges */
.keywords-bar::before,
.keywords-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 1;
}

.keywords-bar::before {
    left: 0;
    background: linear-gradient(to right, rgba(10, 10, 10, 1), transparent);
}

.keywords-bar::after {
    right: 0;
    background: linear-gradient(to left, rgba(10, 10, 10, 1), transparent);
}

/* ========================================
   OVERLAY TAGS (clickable)
   ======================================== */

.overlay-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.overlay-tag,
.info-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.overlay-tag:hover,
.info-tag:hover {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.overlay-tag::before,
.info-tag::before {
    content: '#';
    opacity: 0.6;
    margin-right: 2px;
}

/* ========================================
   ACTIVE FILTERS BAR
   ======================================== */

.active-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    margin-bottom: 12px;
}

.active-filters-bar.hidden {
    display: none;
}

.active-filters-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 500;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--color-primary, #3b82f6);
    border-radius: 6px;
    color: white;
    font-size: 11px;
    font-weight: 500;
}

.active-filter-tag .remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.active-filter-tag .remove-filter:hover {
    background: rgba(255, 255, 255, 0.4);
}

.clear-all-filters {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-all-filters:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ========================================
   FILTER RESULTS COUNT
   ======================================== */

.filter-results-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.filter-results-count .count {
    color: white;
    font-weight: 600;
}

.filter-results-count.no-results {
    color: var(--color-warning, #f59e0b);
}

/* ========================================
   CATEGORY/MODEL CHIPS (dynamic)
   ======================================== */

.category-chips,
.model-chips,
.mood-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-chip,
.model-chip,
.mood-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-chip:hover,
.model-chip:hover,
.mood-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.category-chip.active,
.model-chip.active,
.mood-chip.active {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: white;
}

/* Category chip with image count */
.category-chip .chip-count,
.model-chip .chip-count {
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 10px;
}

.category-chip.active .chip-count,
.model-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   NO RESULTS STATE
   ======================================== */

.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
    text-align: center;
}

.no-results-message span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.clear-filters-btn {
    padding: 8px 16px;
    background: var(--color-primary, #3b82f6);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: var(--color-primary-dark, #2563eb);
    transform: translateY(-1px);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .filter-chips {
        gap: 6px;
    }
    
    .filter-chip {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .search-input-wrapper {
        padding: 6px 10px;
    }
    
    .search-tag {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    .keyword-chip,
    .keyword-tag {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .orientation-chip {
        padding: 8px 12px;
    }
    
    .orientation-chip svg {
        width: 20px;
        height: 20px;
    }
    
    .active-filters-bar {
        flex-wrap: wrap;
    }
    
    .active-filters-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .status-chips {
        width: 100%;
        justify-content: space-around;
    }
    
    .status-chip {
        flex: 1;
        text-align: center;
        padding: 8px;
    }
    
    .orientation-chips {
        width: 100%;
    }
    
    .orientation-chip {
        flex: 1;
    }
}

/* ========================================
   FILTER LOADING STATE
   ======================================== */

.filter-loading {
    position: relative;
    pointer-events: none;
}

.filter-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: inherit;
    animation: filterLoadingPulse 1s ease-in-out infinite;
}

@keyframes filterLoadingPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================
   FILTER VALIDATION (zero result prevention)
   ======================================== */

.filter-chip.will-empty {
    opacity: 0.5;
    border-color: var(--color-warning, #f59e0b);
}

.filter-chip.will-empty::after {
    content: '0';
    margin-left: 4px;
    padding: 1px 5px;
    background: var(--color-warning, #f59e0b);
    border-radius: 8px;
    font-size: 10px;
    color: black;
}
