/* ****** Partie 1 Variables et base vue publique ******** */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --fkp-bg:         #0f0f1a;
    --fkp-surface:    #1a1a2e;
    --fkp-surface-2:  #242440;
    --fkp-border:     rgba(255,255,255,0.08);
    --fkp-text:       #e2e8f0;
    --fkp-muted:      #94a3b8;
    --fkp-accent:     #7c3aed;
    --fkp-accent-l:   #a78bfa;
    --fkp-success:    #10b981;
    --fkp-warning:    #f59e0b;
    --fkp-danger:     #ef4444;
    --fkp-radius:     10px;
    --fkp-radius-sm:  6px;
    --fkp-shadow:     0 8px 32px rgba(0,0,0,0.5);
    --fkp-font:       'Inter', sans-serif;
    --fkp-mine:       rgba(124,58,237,0.18);
    --fkp-mine-border:rgba(124,58,237,0.6);
}

/* ****** Partie 2 Bouton sur la page boutique ******** */
.furzo-kanban-store-btn-wrap {
    margin: 16px 0 8px;
    display: flex;
    justify-content: center;
}
.furzo-kanban-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: var(--fkp-radius-sm);
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--fkp-font);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.furzo-kanban-store-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 6px 24px rgba(124,58,237,0.45);
    transform: translateY(-1px);
}

/* ****** Partie 3 Modal vue publique ******** */
.fkp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999; /* Z-index maximum */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Marge globale minimale */
    font-family: var(--fkp-font);
}
.fkp-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.82); /* Plus sombre */
    backdrop-filter: blur(12px); /* Flou plus prononcé */
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    animation: fkpFadeIn 0.2s ease;
}
.fkp-modal-content {
    position: relative;
    z-index: 1;
    background: var(--fkp-bg);
    border: 1px solid var(--fkp-border);
    border-radius: var(--fkp-radius);
    width: 100%;
    max-width: 1100px;
    height: 85vh; /* 85% de la hauteur de l'écran pour toutes les versions */
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    box-shadow: var(--fkp-shadow);
    animation: fkpSlideUp 0.22s ease;
}
.fkp-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--fkp-border);
    color: var(--fkp-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--fkp-radius-sm);
    z-index: 2;
    transition: all 0.15s;
    font-family: var(--fkp-font);
}
.fkp-modal-close:hover { background: rgba(255,255,255,0.12); color: var(--fkp-text); }

.fkp-modal-inner {
    flex: 1;
    overflow: hidden; /* Plus de scroll global vertical */
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* ****** Partie 4 En-tête de la vue publique ******** */
.fkp-board-header {
    padding: 0 0 20px;
    border-bottom: 1px solid var(--fkp-border);
    margin-bottom: 20px;
}
.fkp-board-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fkp-text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
}
.fkp-board-legend {
    font-size: 12px;
    color: var(--fkp-muted);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.fkp-my-orders-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--fkp-accent-l);
    font-weight: 500;
}
.fkp-mine-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--fkp-mine);
    border: 1.5px solid var(--fkp-mine-border);
}

/* ****** Partie 5 Colonnes vue publique ******** */
.fkp-columns {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    padding-bottom: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--fkp-surface-2) transparent;
    align-items: stretch;
    scroll-snap-type: x mandatory; /* EFFET MAGNET */
    -webkit-overflow-scrolling: touch;
}
.fkp-columns.is-dragging {
    cursor: grabbing !important;
    user-select: none !important;
    scroll-behavior: auto !important;
}
.fkp-columns::-webkit-scrollbar { height: 5px; }
.fkp-columns::-webkit-scrollbar-thumb { background: var(--fkp-surface-2); border-radius: 3px; }

.fkp-column {
    background: var(--fkp-surface);
    border: 1px solid var(--fkp-border);
    border-radius: var(--fkp-radius);
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    scroll-snap-align: center; /* LA COLONNE SE CALE AU CENTRE */
}

.fkp-column-header {
    padding: 12px 14px;
    border-top: 3px solid;
    border-radius: var(--fkp-radius) var(--fkp-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fkp-col-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.fkp-col-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fkp-text);
    flex: 1;
}
.fkp-col-count {
    font-size: 11px;
    background: var(--fkp-surface-2);
    color: var(--fkp-muted);
    padding: 1px 6px;
    border-radius: 20px;
}

.fkp-cards {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto; /* DÉFILEMENT VERTICAL ICI UNIQUEMENT */
    scrollbar-width: thin;
    scrollbar-color: var(--fkp-surface-2) transparent;
}
.fkp-cards::-webkit-scrollbar { width: 5px; }
.fkp-cards::-webkit-scrollbar-thumb { background: var(--fkp-surface-2); border-radius: 3px; }

/* ****** Partie 6 Carte vue publique ******** */
.fkp-card {
    background: var(--fkp-surface-2);
    border: 1px solid var(--fkp-border);
    border-radius: var(--fkp-radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}
.fkp-card:hover {
    border-color: rgba(124,58,237,0.3);
}
/* Surbrillance commande de l'acheteur connecté */
.fkp-card.fkp-is-mine {
    background: var(--fkp-mine);
    border-color: var(--fkp-mine-border);
    box-shadow: 0 0 0 1px var(--fkp-mine-border);
}
.fkp-card.fkp-is-mine .fkp-card-title::before {
    content: '⭐ ';
}

.fkp-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fkp-text);
    line-height: 1.4;
}

.fkp-card-buyer {
    font-size: 12px;
    color: var(--fkp-muted);
}
.fkp-anon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--fkp-muted);
}
.fkp-fursona {
    font-size: 11px;
    color: var(--fkp-accent-l);
    margin-top: 2px;
}

.fkp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--fkp-muted);
    align-items: center;
}
.fkp-badge-furzo {
    background: rgba(124,58,237,0.15);
    color: var(--fkp-accent-l);
    border: 1px solid rgba(124,58,237,0.3);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
}
.fkp-overdue {
    color: var(--fkp-danger);
    font-weight: 600;
}
.fkp-checklist-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--fkp-success);
}

/* ****** Partie 7 États vides et chargement ******** */
.fkp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 20px;
    color: var(--fkp-muted);
    font-size: 14px;
}
.fkp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--fkp-surface-2);
    border-top-color: var(--fkp-accent);
    border-radius: 50%;
    animation: fkpSpin 0.7s linear infinite;
}
.fkp-empty {
    text-align: center;
    padding: 20px 10px;
    color: var(--fkp-muted);
    font-size: 12px;
    font-style: italic;
}

/* ****** Partie 8 Animations ******** */
@keyframes fkpFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes fkpSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fkpSpin {
    to { transform: rotate(360deg); }
}

/* ****** Partie 9 Responsive (Mobile et Tablette) ******** */
@media (max-width: 1024px) {
    /* Centrage parfait avec 85% de hauteur max */
    .fkp-modal {
        align-items: center;
        padding: 10px;
    }
    
    .fkp-modal-content {
        width: 100%;
        height: 85vh; /* 85% de l'écran FORCÉ */
        margin-top: 0;
    }

    .fkp-modal-inner { padding: 12px; }
    .fkp-board-header { padding: 0 0 12px; margin-bottom: 12px; }
    .fkp-board-legend { gap: 8px; }
    
    /* On garde les colonnes à l'horizontale comme pour les artistes */
    .fkp-columns { 
        flex-direction: row !important; 
        overflow-x: auto !important; 
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .fkp-column { 
        width: 280px; 
        min-width: 280px; 
    }
}
