/* dragdrop.css: visual clues for drag-and-drop in dashboard grid */

/* Dashboard Grid Row and Cell Styles */
.dashboard-row {
    /* Styling is handled by JS inline styles for flexbox */
}

.dashboard-cell {
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    border-radius: 12px;
}

.dashboard-cell:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(33, 159, 172, 0.15);
    z-index: 10;
}

.dashboard-cell:active {
    cursor: grabbing;
}

/* Drag Preview */
.drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(33, 159, 172, 0.3);
    border: 3px solid #219fac;
    border-radius: 12px;
    opacity: 0.9;
    animation: dragFloat 2s ease-in-out infinite;
}

@keyframes dragFloat {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.06); }
}

/* Row Drop Target Highlight */
.dashboard-row.drop-target-row {
    background: linear-gradient(135deg, rgba(33, 159, 172, 0.08) 0%, rgba(249, 177, 64, 0.05) 100%);
    border: 2px solid rgba(33, 159, 172, 0.3);
    box-shadow: 0 0 15px rgba(33, 159, 172, 0.2);
    transform: scale(1.02);
    animation: rowHighlightPulse 1.5s ease-in-out infinite;
}

/* New Row Insert Indicator */
.dashboard-row.insert-new-row {
    background: linear-gradient(135deg, rgba(249, 177, 64, 0.12) 0%, rgba(33, 159, 172, 0.08) 100%);
    border: 2px dashed rgba(249, 177, 64, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(249, 177, 64, 0.25);
    min-height: 40px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: newRowPulse 2s ease-in-out infinite;
}

.dashboard-row.insert-new-row::before {
    content: "+ New Row";
    color: rgba(249, 177, 64, 0.8);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes rowHighlightPulse {
    0% { 
        border-color: rgba(33, 159, 172, 0.3);
        box-shadow: 0 0 15px rgba(33, 159, 172, 0.2);
    }
    50% { 
        border-color: rgba(249, 177, 64, 0.4);
        box-shadow: 0 0 20px rgba(249, 177, 64, 0.25);
    }
    100% { 
        border-color: rgba(33, 159, 172, 0.3);
        box-shadow: 0 0 15px rgba(33, 159, 172, 0.2);
    }
}

/* Enhanced Dragging States */
.dashboard-cell.dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.95);
    box-shadow: 0 8px 25px rgba(33, 159, 172, 0.2);
}

.dashboard-cell.drag-over {
    outline: 3px solid #219fac;
    outline-offset: 2px;
    background: rgba(33, 159, 172, 0.1);
    animation: dragOverPulse 1s infinite;
}

@keyframes dragOverPulse {
    0% { outline-color: #219fac; }
    50% { outline-color: #f9b140; }
    100% { outline-color: #219fac; }
}

/* Row Drop Zone */
.dashboard-row.drop-zone {
    background: linear-gradient(135deg, rgba(33, 159, 172, 0.05) 0%, rgba(249, 177, 64, 0.05) 100%);
    border: 2px dashed #219fac;
    border-radius: 12px;
    min-height: 80px;
    animation: dropZonePulse 2s infinite;
}

@keyframes dropZonePulse {
    0% { 
        border-color: #219fac; 
        background: linear-gradient(135deg, rgba(33, 159, 172, 0.05) 0%, rgba(249, 177, 64, 0.05) 100%);
    }
    50% { 
        border-color: #f9b140; 
        background: linear-gradient(135deg, rgba(249, 177, 64, 0.08) 0%, rgba(33, 159, 172, 0.08) 100%);
    }
    100% { 
        border-color: #219fac; 
        background: linear-gradient(135deg, rgba(33, 159, 172, 0.05) 0%, rgba(249, 177, 64, 0.05) 100%);
    }
}

@keyframes newRowPulse {
    0% { 
        border-color: rgba(249, 177, 64, 0.4);
        box-shadow: 0 0 20px rgba(249, 177, 64, 0.25);
    }
    50% { 
        border-color: rgba(33, 159, 172, 0.4);
        box-shadow: 0 0 25px rgba(33, 159, 172, 0.3);
    }
    100% { 
        border-color: rgba(249, 177, 64, 0.4);
        box-shadow: 0 0 20px rgba(249, 177, 64, 0.25);
    }
}

/* Grid Container */
.dashboard-grid {
    position: relative;
    padding: 0;
    background: transparent;
}

/* Enhanced Hover Effects */
.dashboard-cell:not(.dragging):hover {
    animation: cardHover 0.3s ease-out;
}

@keyframes cardHover {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.01); }
    100% { transform: translateY(-4px) scale(1.02); }
}

/* Smooth Card Movement */
.dashboard-cell.moving-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    z-index: 100;
}
