/* =====================================================
   DONYPAY GROW - Pipeline Marchands
   Styles personnalisés améliorés v2.0
   ===================================================== */

/* =========================================
   KANBAN BOARD - LAYOUT PRINCIPAL
   ========================================= */

.kanban-board-container {
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

.kanban-board-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1.5rem;
    /* Scrollbar personnalisée */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.kanban-board-scroll::-webkit-scrollbar {
    height: 10px;
}

.kanban-board-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.kanban-board-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    transition: background 0.3s;
}

.kanban-board-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.kanban-board-inner {
    display: flex;
    gap: 1.5rem;
    min-width: min-content;
    padding: 0.5rem;
}

/* =========================================
   COLONNES KANBAN
   ========================================= */

.kanban-column {
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark .kanban-column {
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(10px);
}

.kanban-column:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* =========================================
   EN-TÊTE DE COLONNE
   ========================================= */

.kanban-column-header {
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* =========================================
   ZONE DE DROP
   ========================================= */

.kanban-drop-zone {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    border-radius: 0 0 12px 12px;

    /* Scrollbar fine pour les colonnes */
    scrollbar-width: thin;
    scrollbar-color: rgba(203, 213, 225, 0.5) transparent;
}

.kanban-drop-zone::-webkit-scrollbar {
    width: 6px;
}

.kanban-drop-zone::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-drop-zone::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 3px;
}

.kanban-drop-zone::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

/* Effet au survol pendant le drag */
.kanban-drop-zone.drag-over {
    background: linear-gradient(
        to bottom,
        rgba(59, 130, 246, 0.03),
        rgba(59, 130, 246, 0.08)
    );
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: 0 0 12px 12px;
    transform: scale(1.01);
}

.dark .kanban-drop-zone.drag-over {
    background: linear-gradient(
        to bottom,
        rgba(59, 130, 246, 0.05),
        rgba(59, 130, 246, 0.12)
    );
}

/* =========================================
   CARTES PROSPECTS
   ========================================= */

.prospect-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    cursor: grab;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dark .prospect-card {
    background: rgba(55, 65, 81, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    backdrop-filter: blur(8px);
}

/* Effet au survol */
.prospect-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.dark .prospect-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* État pendant le drag */
.prospect-card:active {
    cursor: grabbing;
}

.prospect-card.dragging {
    opacity: 0.6;
    transform: rotate(2deg) scale(0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Animation de succès après drop */
.prospect-card.drop-success {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.3);
    }
}

/* Effet de brillance au survol */
.prospect-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
    pointer-events: none;
}

.prospect-card:hover::before {
    left: 100%;
}

/* =========================================
   BADGES ET ÉLÉMENTS DE CARTE
   ========================================= */

/* Badge d'ancienneté avec pulse */
.badge-anciennete {
    animation: badge-pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* Amélioration des icônes */
.prospect-card svg {
    flex-shrink: 0;
}

/* Line clamp pour les textes longs */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   STATS CARDS
   ========================================= */

.stat-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* =========================================
   FILTER BAR
   ========================================= */

.filter-bar {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .filter-bar {
    background: rgba(31, 41, 55, 0.97);
    border: 1px solid rgba(55, 65, 81, 0.8);
}

/* =========================================
   VIEW TOGGLE BUTTONS
   ========================================= */

.view-toggle-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.view-toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.view-toggle-btn:active::before {
    width: 200px;
    height: 200px;
}

/* =========================================
   EMPTY STATE
   ========================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.empty-state:hover {
    opacity: 0.8;
}

/* =========================================
   LOADING OVERLAY
   ========================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   ANIMATIONS D'ENTRÉE
   ========================================= */

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

.prospect-card {
    animation: slideInUp 0.3s ease-out backwards;
}

/* Décalage d'animation pour chaque carte */
.prospect-card:nth-child(1) { animation-delay: 0.05s; }
.prospect-card:nth-child(2) { animation-delay: 0.1s; }
.prospect-card:nth-child(3) { animation-delay: 0.15s; }
.prospect-card:nth-child(4) { animation-delay: 0.2s; }
.prospect-card:nth-child(5) { animation-delay: 0.25s; }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Tablettes */
@media (max-width: 1024px) {
    .kanban-column {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .kanban-board-inner {
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .kanban-board-scroll {
        padding-bottom: 1rem;
    }

    .kanban-column {
        flex: 0 0 100%;
        min-width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .kanban-board-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .kanban-drop-zone {
        max-height: 400px;
    }

    .stat-card {
        margin-bottom: 0.5rem;
    }
}

/* =========================================
   MODE SOMBRE - AJUSTEMENTS
   ========================================= */

.dark .kanban-drop-zone {
    scrollbar-color: rgba(75, 85, 99, 0.5) transparent;
}

.dark .prospect-card::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
}

/* =========================================
   IMPRESSION
   ========================================= */

@media print {
    .filter-bar,
    .view-toggle-btn,
    .stat-card {
        display: none;
    }

    .prospect-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
    }

    .kanban-column {
        page-break-inside: avoid;
        box-shadow: none;
    }

    .kanban-board-inner {
        flex-wrap: wrap;
    }
}

/* =========================================
   ACCESSIBILITÉ
   ========================================= */

.prospect-card:focus,
.view-toggle-btn:focus,
select:focus,
input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 8px;
}

.prospect-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Réduire les animations pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================
   VUE LISTE - TABLE
   ========================================= */

.pipeline-table {
    min-width: 1200px;
}

.pipeline-table tbody tr {
    transition: all 0.2s ease;
}

.pipeline-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: scale(1.005);
}

.dark .pipeline-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* =========================================
   UTILITAIRES SUPPLÉMENTAIRES
   ========================================= */

/* Skeleton loading (pour futur usage) */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.dark .skeleton {
    background: linear-gradient(
        90deg,
        #374151 25%,
        #4b5563 50%,
        #374151 75%
    );
    background-size: 200% 100%;
}

/* Tooltip personnalisé */
.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.custom-tooltip.show {
    opacity: 1;
}

/* Animation de shimmer sur les badges de statut */
.status-badge {
    position: relative;
    overflow: hidden;
}

.status-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* =========================================
   PERFORMANCES
   ========================================= */

/* Optimisation GPU */
.prospect-card,
.kanban-column,
.stat-card {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* =========================================
   FIN DU FICHIER
   ========================================= */
