/**
 * Category Instant Search Styles
 * revizie-front | category-search.css
 */

/* =========================
   SEARCH WRAPPER
   ========================= */
.category-search-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-box-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* =========================
   SEARCH ICON
   ========================= */
.search-icon {
    position: absolute;
    left: 15px;
    color: #e74c3c;
    font-size: 18px;
    z-index: 2;
    pointer-events: none;
}

/* =========================
   SEARCH INPUT
   ========================= */
.category-search-input {
    width: 100%;
    height: 55px;
    padding: 15px 50px 15px 45px;
    font-size: 16px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.1);
}

.category-search-input:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1), 0 4px 10px rgba(231, 76, 60, 0.2);
}

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

/* =========================
   CLEAR BUTTON
   ========================= */
.clear-search-btn {
    position: absolute;
    right: 10px;
    color: #999;
    padding: 5px 10px;
    z-index: 2;
    transition: color 0.3s ease;
}

.clear-search-btn:hover {
    color: #e74c3c;
}

.clear-search-btn:focus {
    box-shadow: none;
    outline: none;
}

/* =========================
   SEARCH RESULTS INFO
   ========================= */
.search-results-info {
    font-size: 14px;
    font-weight: 500;
}

.search-results-info i {
    font-size: 12px;
}

/* Server Search Badge */
.badge-info {
    background-color: #3498db;
    font-size: 13px;
    padding: 6px 12px;
    font-weight: 500;
}

.btn-outline-secondary {
    font-size: 12px;
    padding: 4px 12px;
}

/* =========================
   CATEGORY CARDS
   ========================= */
.category-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: #e74c3c;
}

.category-image {
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Highlight matching text */
.category-name mark {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* =========================
   BADGE STYLING
   ========================= */
.badge {
    font-size: 11px;
    padding: 4px 8px;
    font-weight: 600;
}

.badge-danger {
    background-color: #e74c3c;
}

.badge-secondary {
    background-color: #95a5a6;
}

/* =========================
   BUTTONS
   ========================= */
.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    transform: scale(1.05);
}

.btn-outline-danger {
    color: #e74c3c;
    border-color: #e74c3c;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* =========================
   SUBCATEGORIES
   ========================= */
.subcategories-toggle {
    font-size: 13px;
}

.subcategories-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.subcategories-toggle[aria-expanded="true"] .fa-chevron-down,
.subcategories-toggle .fa-chevron-down.rotate-180 {
    transform: rotate(180deg);
}

.subcategory-item {
    font-size: 14px;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.subcategory-item:hover {
    border-left-color: #e74c3c;
    padding-left: 16px;
    background-color: #f8f9fa;
}

.list-group-item {
    border: 1px solid #eee;
}

.list-group-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* =========================
   NO RESULTS MESSAGE
   ========================= */
#noResultsMessage {
    padding: 40px;
    border-radius: 10px;
}

#noResultsMessage i {
    color: #f39c12;
}

/* =========================
   ANIMATION
   ========================= */
.category-item {
    animation: fadeIn 0.3s ease;
}

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

/* =========================
   MOBILE RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    .category-search-wrapper {
        padding: 20px 15px;
    }
    
    .category-search-input {
        height: 50px;
        font-size: 15px;
        padding: 12px 45px 12px 40px;
    }
    
    .search-icon {
        left: 12px;
        font-size: 16px;
    }
    
    .category-image {
        height: 150px;
    }
    
    .category-name {
        font-size: 14px;
        min-height: 40px;
    }
    
    #noResultsMessage {
        padding: 30px 15px;
    }
}

/* =========================
   LOADING STATE
   ========================= */
.category-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================
   TOTAL CATEGORIES BADGE
   ========================= */
#totalCategories {
    font-size: 14px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

