/* Dashboard Customization Styles */

/* Customization Controls Bar */
.dashboard-customization-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.customization-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.customization-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 2px solid #dee2e6;
}

.customize-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #6c757d;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.2s ease;
}

.customize-toggle:hover {
    border-color: #495057;
    color: #495057;
    background: #f8f9fa;
}

.customize-toggle.active {
    border-color: #007bff;
    color: #007bff;
    background: #e3f2fd;
}

.customization-help {
    margin-top: 12px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
}

/* Customization Mode Styles */
.charts-section.customization-mode .chart-card {
    position: relative;
    cursor: move;
    transition: all 0.2s ease;
    border: 2px dashed transparent;
}

.charts-section.customization-mode .chart-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.charts-section.customization-mode .chart-card.draggable {
    border-style: dashed;
    border-color: #6c757d;
}

.chart-card.dragging {
    opacity: 0.6;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.chart-card.drag-over {
    border-color: #28a745 !important;
    background: #f8fff9;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* Visibility Toggle Button */
.visibility-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.visibility-toggle:hover {
    background: rgba(255, 255, 255, 1);
    color: #495057;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.visibility-toggle.visible {
    color: #28a745;
}

.visibility-toggle.hidden {
    color: #dc3545;
    background: rgba(248, 248, 248, 0.9);
}

.visibility-toggle svg {
    width: 16px;
    height: 16px;
}

/* Hidden Chart Card */
.chart-card.hidden {
    opacity: 0.4;
    filter: grayscale(50%);
    border: 2px dashed #dee2e6 !important;
    background: #f8f9fa;
}

.chart-card.hidden .chart-container {
    pointer-events: none;
}

.chart-card.hidden::after {
    content: 'Hidden';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 5;
}

/* Customization Action Buttons */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    border: none;
    color: #212529;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #ea6100 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-secondary {
    background: #6c757d;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Drop Zone Indicators */
.charts-column.drop-zone-active {
    background: rgba(0, 123, 255, 0.05);
    border: 2px dashed #007bff;
    border-radius: 8px;
    min-height: 200px;
}

.charts-column.drop-zone-active::before {
    content: 'Drop chart here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #007bff;
    font-weight: 500;
    font-size: 16px;
    pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .customization-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .customization-actions {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 2px solid #dee2e6;
        padding-top: 12px;
        margin-top: 12px;
        justify-content: center;
    }
    
    .customize-toggle {
        justify-content: center;
    }
    
    .visibility-toggle {
        position: static;
        width: auto;
        height: auto;
        border-radius: 4px;
        padding: 4px 8px;
        margin-left: auto;
    }
}

/* Dashboard Notification Styles */
.dashboard-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.dashboard-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.dashboard-notification.success {
    border-left-color: #28a745;
}

.dashboard-notification.error {
    border-left-color: #dc3545;
}

.dashboard-notification.info {
    border-left-color: #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
}

.notification-message {
    color: #495057;
    font-weight: 500;
}

/* Drag Indicator */
.charts-section.customization-mode .chart-card::before {
    content: '⋮⋮';
    position: absolute;
    top: 8px;
    left: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: bold;
    z-index: 5;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    padding: 4px;
    line-height: 1;
}

/* Animation for layout changes */
.chart-card {
    transition: all 0.3s ease;
}

.charts-column {
    transition: all 0.3s ease;
}

/* Customization mode active indicator */
.charts-section.customization-mode::before {
    content: '🎨 Customization Mode Active - Drag to reorder, toggle visibility';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    text-align: center;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}
