/**
 * StallWise VetPro - Enterprise Menu Customization CSS
 * Advanced sidebar customization styles
 */

/* Menu Customization Controls */
.menu-customization-controls {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px 8px 0 0;
}

.menu-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.menu-action-buttons {
    display: flex;
    gap: 4px;
}

.control-group {
    margin-top: 8px;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 4px;
}

/* Sidebar States */
.sidebar.pinned {
    position: fixed !important;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar.auto-collapse {
    width: 60px !important;
    transition: width 0.3s ease;
}

.sidebar.auto-collapse:hover,
.sidebar.auto-collapse.expanded {
    width: var(--sidebar-width, 280px) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar.auto-collapse .nav-link span,
.sidebar.auto-collapse .nav-section-title {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar.auto-collapse:hover .nav-link span,
.sidebar.auto-collapse.expanded .nav-link span,
.sidebar.auto-collapse:hover .nav-section-title,
.sidebar.auto-collapse.expanded .nav-section-title {
    opacity: 1;
}

.sidebar.visible {
    transform: translateX(0);
    opacity: 1;
}

.sidebar.hidden {
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Sidebar Position */
.sidebar-left .sidebar {
    left: 0;
    right: auto;
}

.sidebar-right .sidebar {
    right: 0;
    left: auto;
}

.sidebar-right .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width, 280px);
}

/* Sidebar Themes */
.sidebar.theme-light {
    background: #ffffff;
    color: #374151;
    border-right: 1px solid #e5e7eb;
}

.sidebar.theme-dark {
    background: #1f2937;
    color: #f9fafb;
    border-right: 1px solid #374151;
}

.sidebar.theme-dark .nav-link {
    color: #d1d5db;
}

.sidebar.theme-dark .nav-link:hover {
    background: #374151;
    color: #ffffff;
}

.sidebar.theme-dark .nav-section-title {
    color: #9ca3af;
}

.sidebar.theme-blue {
    background: linear-gradient(180deg, #1e40af, #1e3a8a);
    color: #ffffff;
}

.sidebar.theme-blue .nav-link {
    color: #dbeafe;
}

.sidebar.theme-blue .nav-link:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

.sidebar.theme-green {
    background: linear-gradient(180deg, #065f46, #047857);
    color: #ffffff;
}

.sidebar.theme-green .nav-link {
    color: #d1fae5;
}

.sidebar.theme-green .nav-link:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #ffffff;
}

/* Customization Mode */
.sidebar.customizing {
    border: 2px dashed #2563eb;
}

.sidebar.customizing .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.sidebar.customizing .nav-link:hover {
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
    padding-left: 20px;
}

.customize-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar.customizing .nav-link:hover .customize-indicator {
    opacity: 1;
}

/* Drag and Drop */
.nav-link[draggable="true"] {
    cursor: grab;
}

.nav-link[draggable="true"]:active {
    cursor: grabbing;
}

.nav-link.drag-over {
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
}

.drag-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Menu Manager Modal */
.menu-item-config {
    cursor: move;
    transition: all 0.3s ease;
}

.menu-item-config:hover {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.menu-item-config[style*="opacity: 0.5"] {
    transform: rotate(2deg);
}

.drag-handle {
    cursor: grab;
    padding: 8px 4px;
}

.drag-handle:active {
    cursor: grabbing;
}

.menu-items-sortable {
    min-height: 400px;
    padding: 8px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.menu-items-sortable:empty::after {
    content: "Drag menu items here to reorder";
    display: block;
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar.auto-collapse {
        width: 0 !important;
        padding: 0;
    }
    
    .sidebar.auto-collapse.expanded {
        width: 100vw !important;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
    }
    
    .menu-customization-controls {
        padding: 8px 12px;
    }
    
    .menu-controls-header {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animation Classes */
.sidebar-slide-in {
    animation: slideInLeft 0.3s ease;
}

.sidebar-slide-out {
    animation: slideOutLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Menu Item States */
.nav-link.menu-hidden {
    display: none !important;
}

.nav-link.menu-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.nav-link.menu-custom {
    border-left: 3px solid #8b5cf6;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.05), transparent);
}

.nav-link.menu-custom::after {
    content: "CUSTOM";
    position: absolute;
    right: 8px;
    top: 4px;
    font-size: 0.6rem;
    background: #8b5cf6;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Section Headers */
.nav-section-title.customizable::after {
    content: "⚙️";
    float: right;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.nav-section-title.customizable:hover::after {
    opacity: 1;
}

/* Quick Access Panel */
.quick-access-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-access-panel.visible {
    opacity: 1;
    visibility: visible;
}

.quick-access-panel button {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    border: none;
    background: #f8fafc;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-access-panel button:hover {
    background: #2563eb;
    color: white;
}

/* Keyboard Shortcuts Info */
.keyboard-shortcuts-info {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.keyboard-shortcuts-info.visible {
    opacity: 1;
    visibility: visible;
}

.keyboard-shortcuts-info kbd {
    background: #374151;
    color: #f9fafb;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    margin: 0 2px;
}

/* Accessibility */
.sidebar[aria-hidden="true"] {
    visibility: hidden;
}

.nav-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 3px solid #000;
    }
    
    .nav-link {
        border: 1px solid #ccc;
        margin-bottom: 2px;
    }
    
    .menu-customization-controls {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .nav-link,
    .menu-customization-controls * {
        transition: none !important;
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .menu-customization-controls,
    .quick-access-panel,
    .keyboard-shortcuts-info {
        display: none !important;
    }
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Menu Item Spacing in Customization Mode */
.sidebar.customizing .nav-link {
    margin-bottom: 4px;
    border-radius: 8px;
    position: relative;
}

.sidebar.customizing .nav-section {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #d1d5db;
}