/* ========================================
   MARKETPLACE INDEX - MODÈLE HTML EXACT
   Fichier: public/css/marketplace-index.css
   ======================================== */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Container principal */
.marketplace-full {
    min-height: 100vh;
    background: #0f1419;
    padding: 2rem 0;
}

.container-marketplace {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   FIL D'ARIANE
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #8b92a8;
}

.breadcrumb a {
    color: #5b8def;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #7da3f0;
}

/* ========================================
   ALERTES
   ======================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ========================================
   EN-TÊTE
   ======================================== */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #8b92a8;
}

/* ========================================
   RECHERCHE ET FILTRES
   ======================================== */
.search-filters-section {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #252b3d;
    border: 1px solid #2d3548;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: #5b8def;
}

.search-input::placeholder {
    color: #6b7280;
}

.search-btn {
    padding: 0.75rem 1.75rem;
    background: #5b8def;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #4a7ad8;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b92a8;
}

.filter-select {
    padding: 0.65rem 0.875rem;
    background: #252b3d;
    border: 1px solid #2d3548;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #5b8def;
}

.filter-select option {
    background: #1a1f2e;
}

/* ========================================
   BARRE DE STATS
   ======================================== */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #1a1f2e;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.results-count {
    color: #8b92a8;
    font-size: 0.95rem;
}

.results-count strong {
    color: #5b8def;
    font-size: 1.1rem;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    background: #252b3d;
    border: 1px solid #2d3548;
    border-radius: 6px;
    color: #8b92a8;
    cursor: pointer;
}

.view-btn.active {
    background: #5b8def;
    border-color: #5b8def;
    color: white;
}

/* ========================================
   LAYOUT
   ======================================== */
.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.actions-widget {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 1.5rem;
}

.actions-header h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.actions-header p {
    font-size: 0.85rem;
    color: #8b92a8;
    margin-bottom: 1rem;
}

.actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: #252b3d;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.action-item:hover {
    background: #2d3548;
    transform: translateX(3px);
}

.action-item.highlight {
    background: #5b8def;
}

.action-item.highlight:hover {
    background: #4a7ad8;
}

.action-icon {
    font-size: 1.35rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.action-content {
    flex: 1;
}

.action-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-desc {
    font-size: 0.75rem;
    color: #8b92a8;
    margin-top: 0.15rem;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.4rem;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid #2d3548;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #5b8def;
}

.stat-label {
    font-size: 0.7rem;
    color: #8b92a8;
    margin-top: 0.2rem;
}

.login-cta {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 1.75rem;
    text-align: center;
}

.login-cta-icon {
    font-size: 2.5rem;
    margin-bottom: 0.875rem;
}

.login-cta h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: 0.625rem;
}

.login-cta p {
    font-size: 0.875rem;
    color: #8b92a8;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.btn-login {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: #5b8def;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #4a7ad8;
}

.sidebar-section {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 1.25rem;
}

.sidebar-title {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #2d3548;
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 0.4rem;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
    background: #252b3d;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.category-item a:hover {
    background: #2d3548;
}

.category-name {
    color: #e5e7eb;
    font-size: 0.875rem;
}

.category-count {
    color: #5b8def;
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(91, 141, 239, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ========================================
   GRILLE ET CARTES - MODÈLE HTML COMPACT
   ======================================== */
.main-content {
    min-height: 500px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* CARTE COMPACTE */
.item-card {
    background: #12141a;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #1e2029;
    transition: all 0.3s ease;
    cursor: pointer;
}

.item-card:hover {
    border-color: #5865f2;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.2);
    transform: translateY(-2px);
}

.item-card > a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image - CARRÉ PARFAIT */
.item-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #1a1d29;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image-container img {
    transform: scale(1.05);
}

/* Badge Type (bas gauche) */
.item-badge {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.badge-stock {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.badge-out {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.badge-limited {
    background: rgba(251, 191, 36, 0.9);
    color: #000;
}

/* Corps de la carte */
.item-body {
    padding: 0.875rem;
}

/* Titre */
.item-body .item-title {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* Prix */
.item-body .item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #5865f2;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.item-body .price-currency {
    font-size: 0.7rem;
    color: #8b92a8;
    font-weight: 500;
    margin-left: 0.25rem;
}

/* Meta - ligne avec bordure */
.item-body .item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #1e2029;
    font-size: 0.7rem;
}

/* Stock à gauche */
.item-body .meta-left {
    display: flex;
    align-items: center;
}

.item-body .stock-info {
    color: #8b92a8;
}

/* Vendeur + Rating à droite */
.item-body .meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-body .seller-name {
    color: #9ca3af;
    font-weight: 600;
}

.item-body .seller-rating {
    color: #fbbf24;
    font-weight: 600;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}