/* =====================================================
   SEARCH PAGE - Clean Modern Design
   ===================================================== */

/* ----- Base Layout ----- */
.search-page {
    padding: 30px 0 60px;
    background: #F2EFDA;
    min-height: 80vh;
}

.search-page .container-fluid {
    max-width: 100%;
    padding-left: 30px;
    padding-right: 30px;
}

/* ----- Mobile Filter Toggle ----- */
.mobile-filter-toggle {
    display: none;
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
    padding: 14px 24px;
    margin-bottom: 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-filter-toggle i {
    font-size: 18px;
}

.filter-count-badge {
    background: #fff;
    color: #dc3545;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 22px;
}

/* ----- Filter Overlay ----- */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ----- Filter Sidebar ----- */
@media (min-width: 992px) {
    .search-page > .container-fluid > .row {
        align-items: stretch;
    }
}

.filter-sidebar {
    position: relative;
}


.filter-sidebar-inner {
    background: #FFFEF5;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}



.filter-header {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-title {
    font-family: 'Ivy Journal', serif;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-title i {
    color: #dc3545;
    font-size: 16px;
}

.close-filter-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

/* ----- Filter Sections (Collapsible) ----- */
.filter-section {
    padding: 0 20px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section-title {
    font-family: 'Arimo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-section-title:hover {
    color: #555;
}

.filter-section-title i {
    font-size: 12px;
    /* Rotation controlled by GSAP */
}

.filter-section-content {
    overflow: hidden;
    padding-bottom: 16px;
    /* Height and opacity controlled by GSAP for smooth animations */
}

/* ----- Filter Pills (Tag Style) ----- */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    cursor: pointer;
    margin: 0;
}

.filter-pill input {
    display: none;
}

.filter-pill span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #210709;
    color: #fff;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill span i {
    font-size: 14px;
}

.filter-pill:hover span {
    background: #3d0f12;
}

.filter-pill input:checked + span {
    background: #dc3545;
    color: #fff;
}

/* Categories wrap more */
.filter-pills-wrap {
    max-height: 200px;
    overflow-y: auto;
}

.filter-pills-wrap::-webkit-scrollbar {
    width: 4px;
}

.filter-pills-wrap::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}


/* ----- Color Swatches ----- */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    cursor: pointer;
    margin: 0;
}

.color-swatch input {
    display: none;
}

.swatch-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.swatch-circle i {
    font-size: 14px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.color-swatch:hover .swatch-circle {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #999;
}

.color-swatch input:checked + .swatch-circle {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #dc3545;
}

.color-swatch input:checked + .swatch-circle i {
    opacity: 1;
}

/* White swatch special case */
.color-swatch input:checked + .swatch-circle[style*="FFFFFF"] i {
    color: #333;
}


/* ----- Filter Actions ----- */
.filter-actions {
    padding: 18px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
}

.apply-filters-btn {
    flex: 2;
    padding: 12px 16px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.apply-filters-btn:hover {
    background: #c82333;
}

.reset-filters-btn {
    width: 100%;
    padding: 12px 16px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.reset-filters-btn:hover {
    background: #eee;
    color: #333;
}

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

.active-filters-bar {
    background: #FFFEF5;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 24px;
    border: 1px solid #e8e8e8;
}

.active-filters-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-right: 12px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 13px;
    color: #444;
}

.chip-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}

.chip-label {
    font-weight: 500;
}

.chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ddd;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.chip-remove:hover {
    background: #dc3545;
    color: #fff;
}

.chip-remove i {
    font-size: 10px;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.clear-all-btn:hover {
    background: rgba(220, 53, 69, 0.06);
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */

.results-section {
    padding-left: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-info {
    flex: 1;
}

.results-title {
    font-family: 'Ivy Journal', serif;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px;
}

.results-count {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-select {
    appearance: none;
    padding: 10px 40px 10px 16px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s;
}

.sort-select:focus {
    outline: none;
    border-color: #dc3545;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    transition: all 0.2s;
}

.view-btn:hover {
    color: #444;
}

.view-btn.active {
    background: #dc3545;
    color: #fff;
}

/* =====================================================
   RESULTS GRID
   ===================================================== */

.results-grid {
    min-height: 400px;
}

/* Don't override flex-images plugin - it handles its own layout */
.search-page .flex-images .item {
    overflow: hidden;
    border-radius: 8px;
}

.search-page .flex-images .item img {
    transition: transform 0.3s ease;
}

.search-page .flex-images .item:hover img {
    transform: scale(1.03);
}

.search-page .image-title {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-page .action-buttons {
    margin-top: 8px;
}

.search-page .btn-action {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.search-page .btn-action:hover {
    background: #eee;
    color: #dc3545;
}

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

.no-results {
    text-align: center;
    padding: 80px 20px;
    background: #FFFEF5;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.no-results-icon i {
    font-size: 32px;
    color: #ccc;
}

.no-results h3 {
    font-family: 'Ivy Journal', serif;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.no-results p {
    font-size: 15px;
    color: #888;
    margin: 0 0 24px;
}

.no-results .btn {
    padding: 12px 28px;
    font-weight: 600;
}

/* =====================================================
   LOADING INDICATOR
   ===================================================== */

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
    gap: 12px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: #dc3545;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   MOBILE STYLES
   ===================================================== */

@media (max-width: 767px) {
    .mobile-filter-toggle {
        display: flex;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 340px;
        height: 100%;
        z-index: 1000;
        background: #fff;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .filter-sidebar.open {
        left: 0;
    }

    .filter-sidebar-inner {
        border-radius: 0;
        border: none;
        min-height: 100%;
    }

    .filter-header {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .close-filter-btn {
        display: block;
    }

    .results-section {
        padding-left: 0;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-controls {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        min-width: 140px;
        font-size: 13px;
    }
}

@media (min-width: 768px) {
    .close-filter-btn {
        display: none;
    }
}

/* =====================================================
   ANIMATION
   ===================================================== */

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

.filter-accordion-content.open {
    animation: fadeIn 0.2s ease;
}

.filter-chip {
    animation: fadeIn 0.15s ease;
}

/* =====================================================
   TAGS SEARCH INPUT
   ===================================================== */

.tags-search-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.tags-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.tags-autocomplete.show {
    display: block;
}

.tags-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}

.tags-autocomplete-item:hover,
.tags-autocomplete-item.active {
    background: #f5f5f5;
}

.tags-autocomplete-item:last-child {
    border-radius: 0 0 8px 8px;
}

.tags-search-input {
    width: 100%;
    padding: 12px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s, background 0.2s;
}

.tags-search-input:focus {
    outline: none;
    border-color: #dc3545;
    background: #fff;
}

.tags-search-input::placeholder {
    color: #999;
}

.tags-hint {
    font-size: 11px;
    color: #999;
}

/* =====================================================
   CATEGORY SEARCH INPUT
   ===================================================== */

.category-search-wrapper {
    margin-bottom: 12px;
}

.category-search-input {
    width: 100%;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    transition: border-color 0.2s, background 0.2s;
}

.category-search-input:focus {
    outline: none;
    border-color: #dc3545;
    background: #fff;
}

.category-search-input::placeholder {
    color: #999;
}

/* =====================================================
   IMAGE CARD HOVER EFFECT
   ===================================================== */

.image-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-card .image-link {
    display: block;
    position: relative;
}

.image-card img {
    display: block;
    width: 100%;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.03);
}

/* Overlay */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.overlay-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Action buttons */
.image-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.image-card:hover .image-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(50, 50, 50, 0.85);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: rgba(70, 70, 70, 0.95);
    transform: scale(1.1);
    color: #fff;
}

.action-btn i {
    font-size: 18px;
}

.action-btn.btn-like:hover {
    background: #dc3545;
}

.action-btn.btn-like.liked {
    background: #dc3545;
}

.action-btn.btn-like.liked i::before {
    content: "\f415"; /* bi-heart-fill */
}
