/* Distribution Editor Styles - Manual Edit Mode Addition */

/* Summary section with edit button */
.distribution-summary {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
}

.summary-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.summary-stats > div {
    flex: 1;
    min-width: 150px;
}

.edit-mode-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.edit-mode-toggle .btn {
    padding: 8px 16px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.edit-mode-toggle .btn:hover {
    background: #5558d9;
}

/* Manual Edit Container */
#manual-edit-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
     color: #212529 !important;
}

.manual-edit-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.manual-edit-toolbar .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.manual-edit-toolbar .btn-secondary {
    background: #6c757d;
    color: white;
}

.manual-edit-toolbar .btn-secondary:hover {
    background: #5a6268;
}

.manual-edit-toolbar .btn-warning {
    background: #ffc107;
    color: #000;
}

.manual-edit-toolbar .btn-warning:hover {
    background: #ffb300;
}

.manual-edit-toolbar .btn-info {
    background: #17a2b8;
    color: white;
}

.manual-edit-toolbar .btn-info:hover {
    background: #138496;
}

/* Manual Edit Statistics */
.manual-edit-stats {
    display: flex;
    gap: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.manual-edit-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.manual-edit-stats strong {
    font-weight: 600;
    color: #212529;
}

/* Manual Edit Table */
.manual-edit-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.manual-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #212529 !important;  
    background: white; 
}

.manual-edit-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.manual-edit-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    color: #495057 !important;  
    background: #f8f9fa;
}

.manual-edit-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
     color: #212529 !important;
     background: white; 
}


.manual-edit-table tbody tr {
    background: white;  
}
.manual-edit-table tbody tr:hover {
    background: #f8f9fa;
}

.manual-edit-table tbody tr.below-minimum {
    background: #fff3cd;
}

.manual-edit-table tbody tr.below-minimum:hover {
    background: #ffe69c;
}

/* Quantity Input */
.quantity-input {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.quantity-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* Adjust Buttons */
.btn-adjust {
    padding: 4px 8px;
    margin: 0 2px;
    font-size: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-adjust:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.btn-min {
    padding: 4px 8px;
    margin-left: 5px;
    font-size: 12px;
    background: #ffc107;
    color: #000;
    border: 1px solid #ffc107;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-min:hover {
    background: #ffb300;
    border-color: #ffb300;
}

/* Status Colors */
.text-success {
    color: #28a745;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

.text-info {
    color: #17a2b8;
}

/* Distribution Table (Visual Mode) */
.distribution-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.distribution-table thead {
    background: #f8f9fa;
}

.distribution-table th,
.distribution-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.distribution-table tbody tr.below-minimum {
    background: #fff3cd;
}

.distribution-table tbody tr:hover {
    background: #f1f3f5;
}

/* Canvas Container */
#distribution-canvas-container {
    position: relative;
    width: 100%;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
}

#distribution-canvas {
    width: 100%;
    height: 300px;
    cursor: crosshair;
}

/* Responsive Design */
@media (max-width: 768px) {
    .manual-edit-toolbar {
        flex-direction: column;
    }
    
    .manual-edit-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
    
    .manual-edit-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .quantity-input {
        width: 80px;
    }
    
    .btn-adjust {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .manual-edit-table {
        font-size: 12px;
    }
    
    .manual-edit-table th,
    .manual-edit-table td {
        padding: 6px;
    }
}

/* Loading and Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight animation for changes */
.highlight-change {
    animation: highlightRow 0.5s ease-in-out;
}

@keyframes highlightRow {
    0% {
        background-color: #fff3cd;
    }
    50% {
        background-color: #ffe69c;
    }
    100% {
        background-color: inherit;
    }
}

/* Tooltips */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 6px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Error States */
.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 13px;
}