/* css/sealed-catalog.css - Catalogue produits scelles - Layout sidebar */

/* Sub-tabs Référentiel (Cartes / Items / Admin) */
.referentiel-subtabs {
    display: flex;
    gap: 4px;
    padding: 8px 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0;
}

.referentiel-subtab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.referentiel-subtab:hover {
    color: rgba(255,255,255,0.7);
}

.referentiel-subtab.active {
    color: #8ea4f0;
    border-bottom-color: #8ea4f0;
}

/* ═══════════════════════════════════════
   LAYOUT SIDEBAR + MAIN
   ═══════════════════════════════════════ */

.sealed-catalog-layout {
    display: flex;
    gap: 0;
    min-height: 600px;
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.sealed-catalog-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1a1a24 0%, #12121a 100%);
    border-right: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
    overflow-x: hidden;
}

.sealed-catalog-sidebar-content {
    padding: 0;
}

/* Search */
.sealed-sidebar-search {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sealed-sidebar-search-wrap {
    position: relative;
}

.sealed-sidebar-search-input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sealed-sidebar-search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.1);
    border-color: #667eea;
}

.sealed-sidebar-search-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.sealed-sidebar-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

/* Section titles */
.sealed-sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.sealed-sidebar-clickable {
    cursor: pointer;
    transition: filter 0.2s;
}

.sealed-sidebar-clickable:hover {
    filter: brightness(1.15);
}

/* Collapsible sections */
.sealed-sidebar-collapsible {
    cursor: pointer;
    user-select: none;
    transition: filter 0.2s;
}

.sealed-sidebar-collapsible:hover {
    filter: brightness(1.15);
}

.sealed-sidebar-section-chevron {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sealed-sidebar-collapsible:hover .sealed-sidebar-section-chevron {
    opacity: 1;
}

.sealed-sidebar-section-hidden {
    display: none;
}

.sealed-sidebar-total {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Type items */
.sealed-sidebar-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    border-left: 3px solid transparent;
}

.sealed-sidebar-type-item:hover {
    background: rgba(102,126,234,0.1);
    color: #fff;
}

.sealed-sidebar-type-item.selected {
    background: rgba(102,126,234,0.2);
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 500;
}

.sealed-sidebar-type-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.sealed-sidebar-type-count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sealed-sidebar-type-item.selected .sealed-sidebar-type-count {
    background: rgba(102,126,234,0.3);
    color: #667eea;
}

/* Bloc items */
.sealed-sidebar-bloc {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sealed-sidebar-bloc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
    color: rgba(255,255,255,0.8);
}

.sealed-sidebar-bloc-header:hover {
    background: rgba(102,126,234,0.1);
    color: #fff;
}

.sealed-sidebar-bloc.has-selection .sealed-sidebar-bloc-header {
    color: #667eea;
}

.sealed-sidebar-bloc-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.sealed-sidebar-bloc-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102,126,234,0.2);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 300;
    color: #667eea;
    transition: all 0.2s;
}

.sealed-sidebar-bloc.expanded .sealed-sidebar-bloc-toggle {
    background: #667eea;
    color: #fff;
}

.sealed-sidebar-bloc-items {
    background: rgba(0,0,0,0.2);
    padding: 4px 0;
}

.sealed-sidebar-bloc-subitem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 10px 28px;
    cursor: pointer;
    transition: all 0.15s;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    border-left: 3px solid transparent;
}

.sealed-sidebar-bloc-subitem:hover {
    background: rgba(102,126,234,0.1);
    color: #fff;
}

.sealed-sidebar-bloc-subitem.selected {
    background: rgba(102,126,234,0.2);
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */

.sealed-catalog-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    background: #0d0d12;
}

/* Welcome screen */
.sealed-catalog-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    flex: 1;
}

.sealed-welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.sealed-catalog-welcome h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 0 0 10px;
    font-weight: 600;
}

.sealed-welcome-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 30px;
}

.sealed-welcome-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(102,126,234,0.1);
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.sealed-welcome-or {
    margin: 20px 0;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
}

.sealed-welcome-search-hint {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* Results header */
.sealed-catalog-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sealed-results-title h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 600;
}

.sealed-results-count {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-left: 12px;
}

.sealed-sort-select {
    padding: 8px 30px 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.sealed-sort-select option {
    background: #1a1a2e;
    color: #fff;
}

/* ═══════════════════════════════════════
   PRODUCT GRID
   ═══════════════════════════════════════ */

.sealed-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sealed-catalog-card {
    background: #1a1a24;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sealed-catalog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102,126,234,0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.sealed-catalog-card-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    background: linear-gradient(135deg, #1a1a24, #0d0d12);
    padding: 8px;
}

.sealed-catalog-card-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a24, #0d0d12);
    color: rgba(255,255,255,0.15);
    font-size: 3rem;
}

.sealed-catalog-card-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sealed-catalog-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sealed-catalog-card-series {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.sealed-catalog-card-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #81c784;
    margin-top: 2px;
}

.sealed-catalog-card-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(102,126,234,0.2);
    color: #8ea4f0;
    margin-top: 4px;
    align-self: flex-start;
}

.sealed-catalog-card-add {
    padding: 8px;
    text-align: center;
}

.sealed-catalog-card-add button {
    width: 100%;
    padding: 6px;
    border: none;
    border-radius: 6px;
    background: rgba(102,126,234,0.15);
    color: #8ea4f0;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sealed-catalog-card-add button:hover {
    background: rgba(102,126,234,0.3);
    color: #fff;
}

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */

.sealed-catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 0 10px;
    margin-top: auto;
}

.sealed-catalog-pagination button {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.sealed-catalog-pagination button:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.sealed-catalog-pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sealed-catalog-pagination-info {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════
   DETAIL MODAL
   ═══════════════════════════════════════ */

.sealed-catalog-detail-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
}

.sealed-catalog-detail-backdrop.active {
    display: block;
}

.sealed-catalog-detail-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #1e1e28, #14141c);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    z-index: 9999;
    padding: 24px;
}

.sealed-catalog-detail-modal.active {
    display: block;
}

.sealed-catalog-detail-close {
    position: absolute;
    top: 12px; right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    color: rgba(255,255,255,0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sealed-catalog-detail-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.sealed-catalog-detail-content {
    display: flex;
    gap: 20px;
}

.sealed-catalog-detail-image {
    width: 220px;
    flex-shrink: 0;
}

.sealed-catalog-detail-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.sealed-catalog-detail-info h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #fff;
}

.sealed-catalog-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.sealed-catalog-detail-meta span {
    display: flex;
    gap: 8px;
}

.sealed-catalog-meta-label {
    color: rgba(255,255,255,0.4);
    min-width: 80px;
}

.sealed-catalog-detail-prices {
    margin: 12px 0;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
}

.sealed-catalog-price-main {
    font-size: 1.4rem;
    font-weight: 700;
    color: #81c784;
}

.sealed-catalog-price-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.sealed-catalog-price-date {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    margin-top: 4px;
}

.sealed-catalog-detail-desc {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin: 10px 0;
}

.sealed-catalog-detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sealed-catalog-detail-section h5 {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 8px;
}

.sealed-catalog-detail-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sealed-catalog-detail-section li {
    padding: 4px 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

.sealed-catalog-pokepedia-link {
    color: #8ea4f0;
    font-size: 0.8rem;
    display: block;
    margin-top: 10px;
    text-decoration: none;
}

.sealed-catalog-pokepedia-link:hover {
    text-decoration: underline;
}

.sealed-catalog-detail-add {
    margin-top: 20px;
    text-align: center;
}

.sealed-catalog-detail-add button {
    padding: 10px 32px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sealed-catalog-detail-add button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
}

/* ═══════════════════════════════════════
   STATES
   ═══════════════════════════════════════ */

.sealed-catalog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.4);
    text-align: center;
    flex: 1;
}

.sealed-catalog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    flex: 1;
    gap: 12px;
}

.sealed-catalog-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102,126,234,0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: sealed-spin 1s linear infinite;
}

@keyframes sealed-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 992px) {
    .sealed-catalog-layout {
        flex-direction: column;
        max-height: none;
    }

    .sealed-catalog-sidebar {
        width: 100%;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .sealed-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .sealed-catalog-detail-content {
        flex-direction: column;
    }

    .sealed-catalog-detail-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .sealed-catalog-detail-modal {
        width: 95%;
        padding: 16px;
    }

    .sealed-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sealed-catalog-results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
