﻿/* ================================================================
   DASHBOARD PANEL LAYOUT - Professional Two-Panel Design
   For your existing DashboardBuilder.razor
   ================================================================ */

/* Main container */
.dashboard-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
/*    font-family: 'Roboto', 'Noto Sans', system-ui, sans-serif;
*/}

/* Header styling */
.dashboard-header {
    background: white;
    padding: 12px 24px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    z-index: 100;
    min-height: 64px;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-title h2 {
    margin: 0;
    color: #212529;
    font-size: 20px;
    font-weight: 600;
}

.dashboard-name {
    color: #495057 !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    background: #f8f9fa !important;
    border-radius: 4px !important;
    border: 1px solid #dee2e6 !important;
}

.dashboard-header .dashboard-title .widget-count-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 12px !important;
    background: #e7f3ff !important;
    color: #0066cc !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 12px !important;
    border: 1px solid #b3d9ff !important;
}

.dashboard-header .dashboard-title .status-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    letter-spacing: 0.5px !important;
}

.dashboard-header .dashboard-title .status-badge.status-draft {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeaa7 !important;
}

.dashboard-header .dashboard-title .status-badge.status-published {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.dashboard-header .dashboard-title .status-badge.status-archived {
    background: #e2e3e5 !important;
    color: #383d41 !important;
    border: 1px solid #d6d8db !important;
}

.dashboard-header .dashboard-title .type-toggle-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    border: 1px solid !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
}

.dashboard-header .dashboard-title .type-toggle-badge:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.dashboard-header .dashboard-title .type-toggle-badge.type-personal {
    background: #e3f2fd !important;
    color: #1565c0 !important;
    border-color: #90caf9 !important;
}

.dashboard-header .dashboard-title .type-toggle-badge.type-personal:hover {
    background: #bbdefb !important;
    border-color: #64b5f6 !important;
}

.dashboard-header .dashboard-title .type-toggle-badge.type-global {
    background: #f3e5f5 !important;
    color: #6a1b9a !important;
    border-color: #ce93d8 !important;
}

.dashboard-header .dashboard-title .type-toggle-badge.type-global:hover {
    background: #e1bee7 !important;
    border-color: #ba68c8 !important;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Separator between button groups */
.separator {
    width: 1px;
    height: 32px;
    background: #dee2e6;
    margin: 0 8px;
}

/* Main content area - Two panels */
.dashboard-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Left Configuration Panel */
.configuration-panel {
    width: 360px;
    background: white;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.02);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Smooth scrollbar for configuration panel */
.configuration-panel::-webkit-scrollbar {
    width: 6px;
}

.configuration-panel::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.configuration-panel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.configuration-panel::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Loading state for widgets */
.loading-indicator {
    padding: 40px 20px;
    text-align: center;
}

.loading-indicator p {
    margin-top: 16px;
    color: #6c757d;
    font-size: 14px;
}

/* No widgets message */
.no-widgets-message {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.no-widgets-message i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
}

/* Right Grid Container */
.grid-container {
    flex: 1;
    background: #f8f9fa;
    padding: 20px;
    overflow: auto;
    position: relative;
}

/* Grid container modes */
.grid-container.view-mode {
    padding: 30px;
}

.grid-container.edit-mode,
.grid-container.configure-mode {
    background-image:
        linear-gradient(0deg, transparent 0%, rgba(0,123,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, transparent 0%, rgba(0,123,255,0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

dashboard-grid.configure-mode {
    background-image:
        linear-gradient(0deg, transparent 0%, rgba(0,123,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, transparent 0%, rgba(0,123,255,0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Grid overlay (if you have one) */
.grid-overlay {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 20px;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 20px -20px;
}

.grid-info {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.grid-status {
    font-size: 12px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Dashboard grid */
.dashboard-grid {
    position: relative;
    min-height: calc(100vh - 140px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 20px;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    height: 100%;
    color: white;
}

.empty-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

/* Notification Area */
.notification-area {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.notification {
    background: white;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification.info {
    border-left-color: #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 20px;
}

.notification.success i {
    color: #28a745;
}

.notification.error i {
    color: #dc3545;
}

.notification.warning i {
    color: #ffc107;
}

.notification.info i {
    color: #17a2b8;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* Widget Controls (inside grid items) */
.widget-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
    padding: 8px;
    background: rgba(255,255,255,0.95);
    border-radius: 0 8px 0 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-stack-item:hover .widget-controls {
    opacity: 1;
}

.widget-control-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.widget-control-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f0f8ff;
}

.widget-control-btn.danger:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #ffebee;
}

/* Mode badges */
.mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .configuration-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .configuration-panel {
        position: absolute;
        height: 100%;
        z-index: 50;
        width: 100%;
        max-width: 380px;
    }
    
    .configuration-panel.collapsed {
        transform: translateX(-100%);
    }
    
    .dashboard-header {
        padding: 10px 16px;
    }
    
    .dashboard-controls {
        flex-wrap: wrap;
    }
}

/* Radzen Button Customization for Dashboard */
.dashboard-controls .rz-button {
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.dashboard-controls .rz-button-icon-left {
    margin-right: 6px !important;
    font-size: 16px !important;
}

/* Mode buttons */
.dashboard-controls .rz-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
}

.dashboard-controls .rz-button-primary:hover {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4) !important;
    transform: translateY(-1px);
}

/* Success button (Save) */
.dashboard-controls .rz-button-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border: none !important;
}

/* Light buttons (inactive mode) */
.dashboard-controls .rz-button-light {
    background: white !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
}

.dashboard-controls .rz-button-light:hover {
    background: #f8f9fa !important;
    border-color: #007bff !important;
    color: #007bff !important;
}

/* Two-Panel Layout Styles */
.dashboard-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

/* Enhanced Header */
.dashboard-header {
    background: white;
    padding: 0 24px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e3e4e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Mode Switcher Button Group */
.btn-group.mode-switcher {
    display: inline-flex;
    background: #f5f6f7;
    padding: 4px;
    border-radius: 8px;
    gap: 2px;
}

.btn-mode {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #65676b;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #65676b;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mode:hover {
    background: white;
    color: #1876f2;
}

.btn-mode.active {
    background: white;
    color: #1876f2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Gallery Close Button (in header) */
.gallery-close-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    color: #65676b;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gallery-close-btn:hover {
    background: #e4e6eb;
    color: #1876f2;
}

/* Floating tab to show gallery when hidden */
.show-gallery-tab {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 120px;
    background: white;
    border: 1px solid #e3e4e6;
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
    z-index: 10;
}

.show-gallery-tab:hover {
    background: #1876f2;
    color: white;
    width: 48px;
}

.show-gallery-tab i {
    font-size: 18px;
    color: #65676b;
    transition: color 0.2s;
}

.show-gallery-tab:hover i {
    color: white;
}

.show-gallery-tab span {
    writing-mode: vertical-rl;
    font-size: 12px;
    font-weight: 600;
    color: #65676b;
    transition: color 0.2s;
}

.show-gallery-tab:hover span {
    color: white;
}

/* Two Panel Content */
.dashboard-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar-panel {
    width: 340px;  /* Keep your width */
    background: white;
    border-left: 1px solid #e3e4e6;  /* CHANGE: border-left instead of border-right */
    display: flex;
    flex-direction: column;
    
    /* ADD these for right-side positioning */
    /*position: fixed;
    top: 64px;*/  /* Adjust based on your header height */
    /*right: -340px;*/  /* CHANGE: Start hidden off-screen RIGHT */
    /*height: calc(100vh - 64px);
    z-index: 1000;
    transition: right 0.3s ease;*/  /* CHANGE: animate 'right' property */
    /* REMOVE: animation: slideInLeft */
}

/* ADD: When gallery is open */
.sidebar-panel.slide-open {
    right: 0;  /* Slide in to visible position */
}

/* Grid panel takes remaining space - no margin needed, flexbox handles it */
.grid-panel.gallery-open {
    /* No margin needed - flexbox layout automatically handles spacing */
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* OPTIONAL: If you prefer animation over transition */
@keyframes slideInRight {
    from {
        transform: translateX(100%);  /* Start off-screen right */
    }
    to {
        transform: translateX(0);  /* End at normal position */
    }
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e3e4e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-count {
    background: #e7f3ff;
    color: #1876f2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Right Grid Panel */
.grid-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    overflow: hidden;
    padding: 0 0 0 0px;
}

.grid-header {
    background: white;
    padding: 12px 20px;
    border-bottom: 1px solid #e3e4e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.grid-mode {
    font-weight: 600;
    color: #1c1e21;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-stats {
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 6px;
    font-size: 13px;
    color: #65676b;
}

/* Dashboard Grid Area */
.dashboard-grid {
    flex: 1;
    padding: 5px;
    overflow: auto;
    position: relative;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    height: 100%;
    color: white;
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: #1c1e21;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    color: #65676b;
}

/* Mode Badge */
.mode-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-badge.mode-view {
    background: #e7f3ff;
    color: #1876f2;
}

.mode-badge.mode-edit {
    background: #f0f9ff;
    color: #0369a1;
}

.mode-badge.mode-configure {
    background: #fef3c7;
    color: #92400e;
}