/**
 * Categories Style - Spinomax
 * Effet Pinterest masonry pour catégories et roues
 */

/* ========================================
   HEADER PAGE
   ======================================== */

.page-header {
    margin-bottom: 40px;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #bdc3c7;
    transform: translateX(-5px);
}

/* ========================================
   MASONRY GALLERY (Pinterest Style)
   ======================================== */

.gallery-masonry {
    column-count: 4;
    column-gap: 20px;
    margin-bottom: 40px;
}

/* Responsive columns */
@media (max-width: 1200px) {
    .gallery-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        column-count: 1;
    }
}

/* ========================================
   CARTES (Catégories & Roues)
   ======================================== */

.category-card,
.wheel-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ========================================
   IMAGE DE COUVERTURE
   ======================================== */

.card-image {
    width: 100%;
    padding-top: 100%; /* Ratio 4:4 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.card-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    opacity: 0.3;
}

/* ========================================
   CONTENU CARTE
   ======================================== */

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.card-description {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* ========================================
   META (Compteurs, badges)
   ======================================== */

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.card-count,
.card-prizes {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #ecf0f1;
    border-radius: 20px;
    font-weight: 600;
    color: #34495e;
}

.card-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
    font-size: 0.85rem;
}

/* ========================================
   BOUTON JOUER
   ======================================== */

.card-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.card-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.card-btn:active {
    transform: scale(0.98);
}

/* ========================================
   ÉTATS (Loading, Empty, Error)
   ======================================== */

.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.error-state {
    color: #e74c3c;
}

.error-state strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* ========================================
   BOUTON "CHARGER PLUS"
   ======================================== */

.load-more-container {
    text-align: center;
    padding: 30px 0;
}

.btn-load-more {
    padding: 12px 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.btn-load-more:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
    
    .categories-page {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.6rem;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .card-content {
        padding: 15px;
    }
}
