/* ═══════════════════════════════════════════════════════════════
   OpusWebcam V3.0 - Module Binders
   Fichier: binders.css
   Description: Styles pour la bibliotheque de binders virtuels
   Design: Glassmorphism (coherent avec inventory.css et dashboard.css)
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   HEADER BINDERS
   ─────────────────────────────────────────────────────────────── */
.binders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-md) 0;
}

.binders-title h4 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.binders-title .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.9rem;
}

.binders-controls {
    display: flex;
    gap: 8px;
}

/* Boutons d'action style pill (header) */
.storage-nav .storage-nav-actions .btn.storage-action-btn,
button.storage-action-btn {
    background: #374151 !important;
    border: 2px solid #4b5563 !important;
    color: #d1d5db !important;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.storage-nav .storage-nav-actions .btn.storage-action-btn:hover,
button.storage-action-btn:hover {
    border-color: #667eea !important;
    color: #667eea !important;
    background: #374151 !important;
    transform: translateY(-1px);
}

/* ───────────────────────────────────────────────────────────────
   STATS ROW
   ─────────────────────────────────────────────────────────────── */
.binders-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (max-width: 992px) {
    .binders-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .binders-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ───────────────────────────────────────────────────────────────
   GRILLE DES BINDERS - Style Classeur Cuir Réaliste
   ─────────────────────────────────────────────────────────────── */
.binders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
}

@media (min-width: 1200px) {
    .binders-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .binders-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-md);
    }
}

/* ───────────────────────────────────────────────────────────────
   BINDER CARD - Style Classeur Cuir Premium
   ─────────────────────────────────────────────────────────────── */
.binder-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    aspect-ratio: 3/4;
    max-width: 220px;
    background: transparent;
    border-radius: 6px;
    overflow: visible;
    cursor: pointer;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.binder-card:hover {
    transform: translateY(-12px) rotateY(-5deg) scale(1.03);
}

/* Tranche du classeur (reliure) */
.binder-spine-visual {
    width: 24px;
    min-width: 24px;
    height: 100%;
    background:
        linear-gradient(90deg,
            rgba(0, 0, 0, 0.3) 0%,
            var(--binder-color-dark, #3d2817) 15%,
            var(--binder-color-dark, #3d2817) 85%,
            rgba(0, 0, 0, 0.2) 100%);
    border-radius: 6px 0 0 6px;
    position: relative;
    box-shadow:
        inset -2px 0 4px rgba(0, 0, 0, 0.3),
        -2px 4px 8px rgba(0, 0, 0, 0.25);
}

/* Cacher la tranche quand il y a une image custom */
.binder-card.has-cover-image .binder-spine-visual {
    display: none;
}

.binder-card.has-cover-image .binder-cover {
    border-radius: 6px 28px 28px 6px;
}

.binder-card.has-cover-image .binder-cover-image {
    border-radius: 6px 28px 28px 6px;
}

/* Lignes de couture sur la tranche */
.binder-spine-visual::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 84%;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 215, 140, 0.4) 0px,
        rgba(255, 215, 140, 0.4) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Couverture du binder - Texture cuir ou image custom */
.binder-cover {
    flex: 1;
    height: 100%;
    background: var(--binder-color, #8B4513);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0 6px 6px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px;
    overflow: hidden;
    box-shadow:
        4px 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* Image de couverture personnalisée */
.binder-cover.has-cover-image {
    background-color: transparent;
}

.binder-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 6px 6px 0;
    z-index: 0;
}

/* Overlay pour lisibilité du texte sur image */
.binder-cover.has-cover-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.4) 0%,
        transparent 30%,
        transparent 60%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Texture grain de cuir (seulement si pas d'image) */
.binder-cover:not(.has-cover-image)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.06;
    pointer-events: none;
}

/* Effet de lumière sur le cuir (seulement si pas d'image) */
.binder-cover:not(.has-cover-image)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 40%,
        transparent 60%,
        rgba(0, 0, 0, 0.08) 100%
    );
    pointer-events: none;
}

/* Titre du binder - Style embossé */
.binder-cover-title {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

/* Badge type - caché */
.binder-cover-type {
    display: none;
}

/* Preview cartes - caché */
.binder-preview {
    display: none;
}

/* Stats en bas - Style discret */
.binder-cover-stats {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.binder-cover-stats .stat-item {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.binder-cover-stats .stat-item i {
    font-size: 0.7rem;
    opacity: 0.7;
    width: 14px;
}

.binder-cover-stats .stat-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* Infos du binder (legacy - garde pour compatibilite) */
.binder-info-card {
    display: none;
}

/* Actions du binder (au hover) */
.binder-actions-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.binder-card:hover .binder-actions-overlay {
    opacity: 1;
}

.binder-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.binder-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

/* ───────────────────────────────────────────────────────────────
   ETAT VIDE
   ─────────────────────────────────────────────────────────────── */
.binders-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-3xl);
    color: rgba(255, 255, 255, 0.6);
}

.binders-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.binders-empty-state h5 {
    color: #fff;
    margin-bottom: var(--space-sm);
}

.binders-empty-state p {
    margin-bottom: var(--space-lg);
}

/* ───────────────────────────────────────────────────────────────
   VUE DETAIL BINDER (pages ouvertes)
   ─────────────────────────────────────────────────────────────── */
.binder-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.binder-info h4 {
    color: #fff;
    margin: 0;
    font-size: 1.25rem;
}

.binder-info .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.binder-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Navigation pages */
.binder-pages-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.page-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-nav-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    transform: scale(1.1);
}

.page-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* ───────────────────────────────────────────────────────────────
   SPREAD (Double page ouverte)
   ─────────────────────────────────────────────────────────────── */
.binder-spread {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    perspective: 2000px;
    padding: var(--space-xl) 0;
}

/* Page du binder */
.binder-page {
    background: linear-gradient(135deg,
        rgba(30, 30, 40, 0.95) 0%,
        rgba(40, 40, 55, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: var(--space-lg);
    position: relative;
    min-height: 500px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.binder-page-left {
    border-radius: 8px 0 0 8px;
    transform-origin: right center;
    background: linear-gradient(90deg,
        rgba(30, 30, 40, 0.98) 0%,
        rgba(35, 35, 48, 0.95) 100%);
}

.binder-page-right {
    border-radius: 0 8px 8px 0;
    transform-origin: left center;
    background: linear-gradient(90deg,
        rgba(35, 35, 48, 0.95) 0%,
        rgba(30, 30, 40, 0.98) 100%);
}

/* Reliure centrale */
.binder-spine {
    width: 20px;
    background: linear-gradient(90deg,
        #1a1a24 0%,
        #252533 25%,
        #1a1a24 50%,
        #252533 75%,
        #1a1a24 100%);
    border-radius: 0;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    position: relative;
}

.binder-spine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 10%,
        rgba(255, 255, 255, 0.1) 90%,
        transparent 100%);
}

/* Numero de page */
.page-number {
    position: absolute;
    bottom: var(--space-sm);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.binder-page-left .page-number {
    left: var(--space-md);
}

.binder-page-right .page-number {
    right: var(--space-md);
}

/* ───────────────────────────────────────────────────────────────
   GRILLE DES SLOTS (Pochettes 3x3)
   ─────────────────────────────────────────────────────────────── */
.page-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: var(--space-sm);
    height: 100%;
}

/* Slot individuel (pochette) */
.card-slot {
    aspect-ratio: 63/88;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
}

.card-slot:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
}

.card-slot.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Slot vide */
.card-slot.empty::before {
    content: '+';
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.card-slot.empty:hover::before {
    color: rgba(102, 126, 234, 0.5);
    transform: scale(1.2);
}

/* Slot avec carte */
.card-slot.filled {
    border: none;
    background: transparent;
}

.card-slot .slot-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

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

/* Badge de suppression sur slot */
.slot-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-slot.filled:hover .slot-remove-btn {
    opacity: 1;
}

.slot-remove-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* ───────────────────────────────────────────────────────────────
   MODALS BINDERS
   ─────────────────────────────────────────────────────────────── */
.binder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: none;
}

.binder-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.binder-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.binder-modal-content {
    position: relative;
    background: rgba(30, 30, 40, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.binder-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.binder-modal-header h4 {
    margin: 0;
    color: #fff;
}

.binder-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.binder-modal-close:hover {
    background: rgba(220, 53, 69, 0.5);
}

.binder-modal-body {
    padding: var(--space-lg);
}

.binder-modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Form dans modal */
.binder-form-group {
    margin-bottom: var(--space-lg);
}

.binder-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.binder-form-group input,
.binder-form-group select,
.binder-form-group textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.binder-form-group input:focus,
.binder-form-group select:focus,
.binder-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.binder-form-group select option {
    background: #1f2937;
    color: #fff;
}

/* Selecteur de couleur */
.color-picker-row {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Selecteur de cover image */
.cover-picker {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cover-picker select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.cover-upload-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.cover-upload-row .btn {
    white-space: nowrap;
}

.cover-preview {
    display: none;
    margin-top: var(--space-sm);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    max-height: 120px;
}

.cover-preview.has-preview {
    display: block;
}

.cover-preview img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
}

/* ───────────────────────────────────────────────────────────────
   MODAL SELECTION CARTES
   ─────────────────────────────────────────────────────────────── */
.card-picker-modal .binder-modal-content {
    max-width: 900px;
}

.card-picker-search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.card-picker-search input {
    flex: 1;
}

.card-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-sm);
}

.card-picker-item {
    aspect-ratio: 63/88;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.card-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-picker-item:hover {
    transform: scale(1.05);
    border-color: rgba(102, 126, 234, 0.5);
}

.card-picker-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.card-picker-item.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
}

/* ───────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .binder-spread {
        flex-direction: column;
        align-items: center;
    }

    .binder-page {
        width: 100%;
        max-width: 380px;
    }

    .binder-page-left {
        border-radius: 8px 8px 0 0;
    }

    .binder-page-right {
        border-radius: 0 0 8px 8px;
    }

    .binder-spine {
        width: 100%;
        height: 10px;
    }

    .binder-spine::before {
        width: 100%;
        height: 2px;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .binder-detail-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .binder-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .binders-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .page-slots {
        gap: 4px;
    }

    .binder-page {
        padding: var(--space-sm);
        min-height: 350px;
    }
}

/* ───────────────────────────────────────────────────────────────
   COULEURS PREDEFINIES POUR BINDERS
   ─────────────────────────────────────────────────────────────── */
.binder-color-blue {
    --binder-color: #667eea;
    --binder-color-end: #764ba2;
    --binder-color-dark: #4a5cc8;
    --binder-glow: 102, 126, 234;
}

.binder-color-red {
    --binder-color: #e53e3e;
    --binder-color-end: #c53030;
    --binder-color-dark: #9b2c2c;
    --binder-glow: 229, 62, 62;
}

.binder-color-green {
    --binder-color: #38a169;
    --binder-color-end: #276749;
    --binder-color-dark: #1e5245;
    --binder-glow: 56, 161, 105;
}

.binder-color-yellow {
    --binder-color: #d69e2e;
    --binder-color-end: #b7791f;
    --binder-color-dark: #8b5c14;
    --binder-glow: 214, 158, 46;
}

.binder-color-purple {
    --binder-color: #805ad5;
    --binder-color-end: #553c9a;
    --binder-color-dark: #44337a;
    --binder-glow: 128, 90, 213;
}

.binder-color-pink {
    --binder-color: #ed64a6;
    --binder-color-end: #b83280;
    --binder-color-dark: #97266d;
    --binder-glow: 237, 100, 166;
}

.binder-color-orange {
    --binder-color: #ed8936;
    --binder-color-end: #c05621;
    --binder-color-dark: #9c4221;
    --binder-glow: 237, 137, 54;
}

.binder-color-teal {
    --binder-color: #319795;
    --binder-color-end: #234e52;
    --binder-color-dark: #1d4044;
    --binder-glow: 49, 151, 149;
}

.binder-color-gray {
    --binder-color: #4a5568;
    --binder-color-end: #2d3748;
    --binder-color-dark: #1a202c;
    --binder-glow: 74, 85, 104;
}

.binder-color-black {
    --binder-color: #2d3748;
    --binder-color-end: #1a202c;
    --binder-color-dark: #0d1117;
    --binder-glow: 45, 55, 72;
}

/* ───────────────────────────────────────────────────────────────
   ANIMATIONS
   ─────────────────────────────────────────────────────────────── */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.binder-page-left {
    animation: slideInFromLeft 0.4s ease-out;
}

.binder-page-right {
    animation: slideInFromRight 0.4s ease-out;
}

.binder-card {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.binder-card:nth-child(1) { animation-delay: 0.05s; }
.binder-card:nth-child(2) { animation-delay: 0.1s; }
.binder-card:nth-child(3) { animation-delay: 0.15s; }
.binder-card:nth-child(4) { animation-delay: 0.2s; }
.binder-card:nth-child(5) { animation-delay: 0.25s; }
.binder-card:nth-child(6) { animation-delay: 0.3s; }

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

/* ═══════════════════════════════════════════════════════════════
   STORAGE / RANGEMENTS - Navigation et Containers
   ═══════════════════════════════════════════════════════════════ */

/* Navigation des sous-onglets */
.storage-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.storage-nav .btn-group {
    background: transparent;
    display: flex;
    gap: 8px;
}

.storage-nav-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.storage-nav .storage-nav-btn,
.storage-nav .storage-nav-btn.btn-outline-primary {
    background: #374151 !important;
    border: 2px solid #4b5563 !important;
    color: #d1d5db !important;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.storage-nav .storage-nav-btn:not(.active):hover,
.storage-nav .storage-nav-btn.btn-outline-primary:not(.active):hover {
    border-color: #667eea !important;
    color: #667eea !important;
    background: #374151 !important;
    transform: translateY(-1px);
}

.storage-nav .storage-nav-btn.active,
.storage-nav .storage-nav-btn.btn-outline-primary.active {
    background: #374151 !important;
    border: 2px solid #667eea !important;
    padding: 8px 16px !important;
    color: #667eea !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* ───────────────────────────────────────────────────────────────
   CONTAINERS VIEW
   ─────────────────────────────────────────────────────────────── */
.containers-view {
    animation: fadeIn 0.3s ease;
}

.containers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-md) 0;
}

.containers-title h4 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.containers-title .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.9rem;
}

/* Grille des containers */
.containers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* Carte container */
.container-card {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.container-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.container-card-icon {
    font-size: 2.5rem;
    text-align: center;
}

.container-card-info h5 {
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.container-card-info .container-type {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.container-card-stats {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.container-card-stats .cards-count {
    color: rgba(255, 255, 255, 0.7);
}

.container-card-stats .value {
    color: #10b981;
    font-weight: 600;
}

.container-card-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

/* Empty state containers */
.containers-empty-state {
    text-align: center;
    padding: var(--space-3xl);
    grid-column: 1 / -1;
}

.containers-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.containers-empty-state h5 {
    color: #fff;
    margin-bottom: var(--space-sm);
}

/* Container detail view */
.container-detail {
    animation: fadeIn 0.3s ease;
}

.container-detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: var(--space-md) 0;
}

.container-detail-header .container-info {
    flex: 1;
}

.container-detail-header .container-info h4 {
    margin: 0;
    color: #fff;
}

/* Grille des cartes dans un container */
.container-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
}

.container-card-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 0.72;
    transition: transform 0.2s ease;
}

.container-card-item:hover {
    transform: scale(1.05);
}

.container-card-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container-card-item .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.container-card-item:hover .card-overlay {
    opacity: 1;
}

.container-card-item .card-name {
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.container-card-item .remove-card {
    padding: 2px 6px;
    font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════
   SELECTEUR DE COVERS PAR CATEGORIES
   ═══════════════════════════════════════════════════════════════ */

/* Modal plus large pour le selecteur de covers */
.binder-modal-large {
    max-width: 900px !important;
    width: 95% !important;
}

/* Layout en colonnes */
.binder-form-row {
    display: flex;
    gap: var(--space-xl);
}

.binder-form-col {
    flex: 1;
}

.binder-form-col.cover-col {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Preview large de la cover selectionnee */
.cover-preview-large {
    width: 160px;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cover-preview-large.has-preview {
    border-style: solid;
    border-color: #667eea;
}

.cover-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.cover-preview-large .no-cover {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--space-md);
}

/* Section du picker de covers */
.cover-picker-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
    margin-top: var(--space-md);
    max-height: 350px;
    overflow-y: auto;
}

/* Categorie de covers */
.cover-category {
    margin-bottom: var(--space-lg);
}

.cover-category-header {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cover-category-header::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #667eea;
    border-radius: 2px;
}

/* Grille des miniatures */
.cover-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Miniature de cover */
.cover-thumb {
    width: 60px;
    height: 75px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
}

.cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-thumb:hover {
    transform: scale(1.08);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cover-thumb.selected {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.cover-thumb.selected::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
}

/* Positionner le check */
.cover-thumb {
    position: relative;
}

/* Responsive pour la modal */
@media (max-width: 768px) {
    .binder-modal-large {
        max-width: 100% !important;
        width: 100% !important;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .binder-form-row {
        flex-direction: column;
    }

    .binder-form-col.cover-col {
        flex: none;
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-md);
    }

    .cover-preview-large {
        width: 100px;
        height: 125px;
    }

    .cover-picker-section {
        max-height: 250px;
    }

    .cover-thumb {
        width: 50px;
        height: 62px;
    }
}
