/* ===========================================
   WARDROBE - Ma Penderie
   =========================================== */

/* Container principal */
.wardrobe-container {
    padding: 0;
}

/* Header avec stats */
.wardrobe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.wardrobe-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filtres par catégorie */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-filter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #fff;
    border: 1.5px solid #e9ecef;
    border-radius: 0px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-filter i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.category-filter .category-icon {
    font-size: 0.95rem;
}

.category-filter .category-count {
    background: #e9ecef;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.category-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.category-filter.active i {
    opacity: 1;
}

.category-filter.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Barre de recherche */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.85rem 3rem;
    border: 1.5px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8f9fa;
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(17, 159, 184, 0.15);
}

.search-input:not(:placeholder-shown) {
    color: var(--primary);
}

.search-input::placeholder {
    color: #aaa;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #f8f9fa;
    color: #495057;
}

.view-toggles {
    display: flex;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 0px;
    overflow: hidden;
}

.view-toggle {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle:hover {
    background: #f8f9fa;
}

.view-toggle.active {
    background: var(--primary);
    color: #fff;
}

/* Grille de vêtements */
.clothes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.clothes-grid.list-view {
    grid-template-columns: 1fr;
}

.clothes-grid.list-view .clothe-card {
    display: flex;
    flex-direction: row;
    height: auto;
}

.clothes-grid.list-view .clothe-image-wrapper {
    width: 120px;
    min-width: 120px;
    height: 120px;
}

.clothes-grid.list-view .clothe-info {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Carte de vêtement */
.clothe-card {
    background: #fff;
    border-radius: 0px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.clothe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.clothe-card.hidden {
    display: none;
}

.clothe-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.clothe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.clothe-card:hover .clothe-image {
    transform: scale(1.05);
}

/* Overlay avec boutons toujours visibles */
.clothe-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.clothe-card:hover .clothe-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 50%);
}

.overlay-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.clothe-card:hover .overlay-btn {
    transform: translateY(0);
    opacity: 1;
}

.clothe-card:hover .overlay-btn:nth-child(1) { transition-delay: 0s; }
.clothe-card:hover .overlay-btn:nth-child(2) { transition-delay: 0.05s; }
.clothe-card:hover .overlay-btn:nth-child(3) { transition-delay: 0.1s; }

.overlay-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.overlay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton favori */
.favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.favorite-btn:hover,
.favorite-btn.active {
    color: #e74c3c;
    transform: scale(1.1);
}

.favorite-btn.active {
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.3); }
}

/* Informations du vêtement */
.clothe-info {
    padding: 1.25rem;
}

.clothe-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3436;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clothe-category {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
}

.clothe-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.clothe-brand {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.clothe-color {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.clothe-size {
    font-size: 0.8rem;
    color: #adb5bd;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 2.5rem;
    color: #adb5bd;
}

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

.empty-state p {
    color: #6c757d;
    margin: 0;
}

/* Modal de prévisualisation
   Utilise les classes communes de base.css:
   .preview-container, .preview-image-wrapper, .preview-image,
   .preview-details, .preview-name, .preview-meta, .meta-item, .preview-actions
*/

@media (max-width: 768px) {
    .wardrobe-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wardrobe-stats {
        justify-content: space-around;
    }
    
    .wardrobe-actions {
        text-align: center;
    }
    
    .btn-add-clothe {
        width: 100%;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .view-toggles {
        align-self: flex-end;
    }
    
    .clothes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .clothe-image-wrapper {
        height: 200px;
    }
    
    .clothe-info {
        padding: 1rem;
    }
    
    .clothe-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 1.5rem;
    }
    
    .category-filter {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .category-filter .category-count {
        padding: 0.1rem 0.35rem;
        font-size: 0.65rem;
    }
    
    .clothes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .clothe-image-wrapper {
        height: 160px;
    }
}

/* ===========================================
   MODE INVITÉ - Demo Overlay
   Utilise les classes communes de base.css:
   .demo-blur, .demo-overlay, .demo-overlay-content, .demo-overlay-icon
   =========================================== */

.demo-wardrobe-wrapper {
    position: relative;
    min-height: 400px;
}

.demo-wardrobe-wrapper .clothes-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive pour le mode invité */
@media (max-width: 992px) {
    .demo-wardrobe-wrapper .clothes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .demo-wardrobe-wrapper .clothes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================================
   MODAL D'AJOUT DE VÊTEMENT
   Utilise les styles communs de base.css
   =========================================== */

#addClotheModal .upload-zone {
    max-width: 100%;
    min-height: 200px;
    aspect-ratio: auto;
}

/* ===========================================
   MODAL D'ÉDITION DE VÊTEMENT
   =========================================== */

.edit-image-preview {
    text-align: center;
}

.edit-image-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
}

/* ===========================================
   SÉLECTION MULTIPLE
   Utilise les classes communes de base.css
   =========================================== */

.clothe-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.clothe-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(17, 159, 184, 0.3), var(--shadow);
}

.clothe-card.selected .clothe-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 159, 184, 0.1);
    pointer-events: none;
}
