/* Categories Page Styles */

/* Category Tree Styles */
.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-parent {
    font-weight: 600;
    color: #333;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.category-parent:last-child {
    border-bottom: none;
}

.subcategory-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 0;
}

.subcategory-item { 
    transition: background-color 0.2s ease;
}

.subcategory-item:hover {
    background-color: #f8f9fa;
    padding-left: 8px;
    transition: all 0.2s ease;
}

.subcategory-item a {
    color: #666;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-count {
    font-size: 0.8em;
    color: #999;
    margin-left: auto;
    font-weight: normal;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Breadcrumb Styles */
.breadcrumb-custom {
    border-radius: 8px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out;
    background: -webkit-linear-gradient(94deg, #fccb90 6%, #d57eeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.breadcrumb-custom a {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    background: -webkit-linear-gradient(94deg, #fccb90 6%, #d57eeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.breadcrumb-custom a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Category Toggle Styles */
.category-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    width: 100%;
}

.category-toggle i {
    transition: transform 0.3s ease;
    margin-right: 8px;
    font-size: 0.9em;
    background: -webkit-linear-gradient(80deg, #fccb90 0%, #d57eeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-toggle.collapsed i {
    transform: rotate(-90deg);
}

.category-toggle a {
    flex: 1;
    margin-left: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-toggle a:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Product Card Enhancements */
.categories-page {
    margin-bottom: 2rem;
}

.course-box {
    width: 100%;
}

.product {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-img {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    width: 100%;
    height: 300px;
}

.product-img img {
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
}

.product:hover .product-img img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    transition: transform 0.2s ease;
    z-index: 10;
}

.product-badge:hover {
    transform: scale(1.1);
}

.product-category small {
    color: #6c757d;
    font-weight: 500;
}

/* Price Display */

.price h3 span {
    font-size: 0.8em;
    color: #ec921c;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 500;
}

/* Filter Card Styles */
.search-filter {
    border: none;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.search-filter .card-body {
    padding: 20px;
    background: white;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.categories-head h4 {
    color: #333;
    font-weight: 600;
    margin: 0;
    font-size: 1.1em;
}

/* Form Controls */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-search {
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    background: -webkit-linear-gradient(80deg, #fccb90 0%, #d57eeb 100%);
    border: none;
    color: #fff;
}

.btn-filter {
    background: -webkit-linear-gradient(94deg, #ec962d 10%, #d57eeb60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 2px solid #fccb90;
}
/* Mobile Filter Button */
.btn-outline-primary {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn-fixed {
    position: fixed;
    top: 15px;
    left: 15px;
    right: 15px;
    z-index: 999;
    width: calc(100% - 30px) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Pagination Styles */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background: -webkit-linear-gradient(80deg, #fccb90 0%, #d57eeb 100%);
    border: none;
}

.pagination .page-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    border: none;
}

/* Results Header */
.results-header h5 {
    color: #333;
    font-weight: 600;
}

.results-header small {
    color: #6c757d;
    font-weight: normal;
}

/* Loading Overlay */
#filter-loading {
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .category-parent {
        padding: 12px 0;
    }
    
    .subcategory-list {
        padding-left: 15px;
    }
    
    .breadcrumb-custom {
        padding: 0 15px;
        margin-bottom: 20px;
    }
    
    .search-filter .card-body {
        padding: 15px;
    }
    .categories-products {
        padding: 0 30px;
    }
    .product-img {
        height: 260px;
    }
}

@media (max-width: 767.98px) {
    .product-img {
        height: 330px;
    }
}

@media (max-width: 575.98px) {
    .category-count {
        font-size: 0.75em;
        padding: 1px 4px;
    }
    
    .product-badge {
        top: 8px;
        right: 8px;
        padding: 3px 8px;
        font-size: 0.7em;
    }
    .categories-page {
        width: 50%;
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    .product-img {
        height: 240px;
    }

    .product-category small {
        font-size: 0.75rem;
    }

    .price h3 span {
        font-size: 0.75rem;
    }
    .product-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {
    .filter-clear,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .col-lg-9 {
        width: 100% !important;
    }
}

/* Selected Category Gradient Styles */
.category-toggle a.text-primary,
.subcategory-item.active a,
.subcategory-item.active a span {
    background: -webkit-linear-gradient(80deg, #fccb90 0%, #d57eeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
    .category-toggle a.text-primary,
    .subcategory-item.active a,
    .subcategory-item.active a span {
        color: #d57eeb !important;
        background: none;
    }
}

/* Title Truncation */

/* Category Names Truncation */
.category-toggle a,
.subcategory-item a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 200px;
    font-weight: 400;
}


/* Mobile Responsive Title Truncation */
@media (max-width: 575.98px) {
    .product-content .title {
        -webkit-line-clamp: 3;
        max-height: 4.2em;
    }
    
    .category-toggle a,
    .subcategory-item a span {
        max-width: 150px;
    }
    
    .breadcrumb-custom a {
        max-width: 100px;
    }
    
    .categories-page{
        width:50%;
    }
}
