/* Categories Container */
.categories-container {
    min-height: calc(100vh - 200px); /* Adjust for navbar and footer */
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem; /* Add space before footer */
}

.categories-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.categories-content .row {
    flex: 1;
    margin: 0 -10px; /* Compensate for card padding */
}

.categories-content .col-md-4 {
    padding: 10px;
    margin-bottom: 1rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    border-radius: 2px;
}

.page-header h1 {
    color: #2d3748;
    font-weight: 600;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #718096;
    margin-bottom: 0;
}

/* Category Cards */
.category-card {
    background: white;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.category-card .card-title {
    margin-bottom: 1rem;
    position: relative;
}

.category-card .card-title a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.category-card .card-title a:hover {
    color: #007bff;
    transform: translateX(-5px);
}

/* Category Icon */
.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.category-card:hover .category-icon::after {
    transform: translateX(100%);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* Category Toggle Button */
.category-toggle {
    background: transparent;
    border: none;
    color: #007bff;
    padding: 0.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.category-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 123, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-toggle:hover::before {
    opacity: 1;
}

.category-toggle i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.category-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Category Count Badge */
.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    position: relative;
    overflow: hidden;
}

/* Subcategories List */
.subcategories {
    margin-top: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.subcategories .list-group {
    border: none;
    margin: 0;
    padding: 0;
}

.subcategories .list-group-item {
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 123, 255, 0.03);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subcategories .list-group-item:hover {
    background: rgba(0, 123, 255, 0.08);
    transform: translateX(5px);
}

.subcategories .list-group-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subcategories .list-group-item:hover::before {
    opacity: 1;
}

.subcategories .list-group-item a {
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.subcategories .list-group-item a:hover {
    color: #007bff;
}

.subcategories .list-group-item ul {
    margin-top: 0.75rem;
    padding-right: 1rem;
    border-right: 2px solid rgba(0, 123, 255, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(0, 123, 255, 0.03);
    border-radius: 1rem;
    margin: 2rem 0;
}

.empty-state i {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #2d3748;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .category-card {
        margin-bottom: 1rem;
    }
    
    .category-card .card-title {
        font-size: 1.1rem;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .subcategories .list-group-item {
        padding: 0.5rem 0.75rem;
    }

    .category-toggle {
        padding: 0.25rem;
    }
}
