/**
 * BMV Categories AJAX Styling
 * 
 * @package Fana Child
 * @version 1.0.0
 */

/* Categories Container */
.bmv-categories-shortcode,
.bmv-category-item {
    margin-bottom: 20px;
}

/* Category Grid Layout */
.bmv-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Category Item */
.bmv-category-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bmv-category-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Category Image */
.category-image {
    margin-bottom: 15px;
}

.category-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.bmv-category-item:hover .category-image img {
    transform: scale(1.05);
}

/* Category Info */
.category-info {
    text-align: center;
}

.category-name {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.category-name a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.category-name a:hover {
    color: #007cba;
}

/* Category Description */
.category-description {
    margin: 10px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Category Count */
.category-count {
    color: #999;
    font-size: 0.85em;
    font-style: italic;
}

/* Loading States */
.bmv-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.bmv-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: bmv-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes bmv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.bmv-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 4px solid #d32f2f;
}

.bmv-no-categories {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bmv-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .bmv-category-item {
        padding: 12px;
    }
    
    .category-image img {
        height: 120px;
    }
    
    .category-name {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .bmv-categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bmv-category-item {
        padding: 10px;
    }
    
    .category-image img {
        height: 100px;
    }
}

/* Custom Template Styles */
.custom-category {
    text-align: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.custom-category:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,124,186,0.2);
}

.custom-category a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.custom-category img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.custom-category h4 {
    margin: 10px 0 5px 0;
    color: #333;
    font-size: 1.1em;
}

.custom-category span {
    color: #666;
    font-size: 0.9em;
}

/* Subcategory Styles */
.subcategory-item {
    margin-left: 20px;
    border-left: 2px solid #eee;
    padding-left: 15px;
}

.subcategory-item .category-name {
    font-size: 1em;
}

/* Animation Classes */
.bmv-fade-in {
    animation: bmv-fadeIn 0.5s ease-in;
}

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

.bmv-slide-in {
    animation: bmv-slideIn 0.5s ease-out;
}

@keyframes bmv-slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.bmv-text-center { text-align: center; }
.bmv-text-left { text-align: left; }
.bmv-text-right { text-align: right; }

.bmv-mb-10 { margin-bottom: 10px; }
.bmv-mb-20 { margin-bottom: 20px; }
.bmv-mb-30 { margin-bottom: 30px; }

.bmv-mt-10 { margin-top: 10px; }
.bmv-mt-20 { margin-top: 20px; }
.bmv-mt-30 { margin-top: 30px; }

/* Theme Integration */
.bmv-category-item .category-name a {
    color: inherit;
}

/* WooCommerce Integration */
.woocommerce .bmv-category-item {
    border-color: #e0e0e0;
}

.woocommerce .bmv-category-item:hover {
    border-color: #007cba;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bmv-category-item {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .category-name a {
        color: #fff;
    }
    
    .category-description {
        color: #ccc;
    }
    
    .category-count {
        color: #999;
    }
    
    .bmv-error {
        background: #4a1a1a;
        color: #ff6b6b;
    }
}
