/* SoftIT Modern Admin Panel Custom Styles */
:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --secondary-500: #14b8a6;
    --secondary-600: #0d9488;
    --accent-500: #ff6a00;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile & Global Responsive Layout Fixes */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.admin-main-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 0;
}

/* Sidebar Collapsed / Minimized Styles (Desktop Only >= 1024px) */
@media (min-width: 1024px) {
    body.sidebar-minimized #admin-sidebar {
        width: 5rem !important; /* 80px */
    }
    body.sidebar-minimized .admin-main-wrapper {
        padding-left: 5rem !important;
    }
    body.sidebar-minimized .sidebar-full-logo {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-compact-logo {
        display: block !important;
    }
    body.sidebar-minimized #sidebar-search-container {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-nav-header {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-nav-item span.sidebar-text {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-dropdown-chevron {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-submenu-container {
        display: none !important;
    }
    body.sidebar-minimized .sidebar-nav-item {
        justify-content: center !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    body.sidebar-minimized .sidebar-collapse-icon {
        transform: rotate(180deg);
    }
    body.sidebar-minimized .admin-footer-info {
        display: none !important;
    }
    body.sidebar-minimized .admin-footer-container {
        justify-content: center !important;
        padding: 0.75rem 0.25rem !important;
    }
}

/* Ensure mobile main wrapper never has left padding */
@media (max-width: 1023px) {
    body.sidebar-minimized .admin-main-wrapper,
    .admin-main-wrapper {
        padding-left: 0 !important;
    }
}

/* Floating Mini Sidebar Flyout and Tooltip */
.sidebar-floating-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0.5rem;
    background-color: #0f172a;
    color: #f8fafc;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.sidebar-floating-tooltip.show {
    opacity: 1;
    transform: scale(1);
}

.sidebar-floating-flyout {
    position: fixed;
    z-index: 9999;
    min-width: 13rem;
    max-width: 18rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    animation: flyoutFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dark .sidebar-floating-flyout {
    background-color: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
@keyframes flyoutFadeIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Drag and Drop Sortable Styling */
.sortable-ghost {
    opacity: 0.35 !important;
    background-color: #e0e7ff !important;
    border: 2px dashed #6366f1 !important;
}
.dark .sortable-ghost {
    background-color: #312e81 !important;
    border: 2px dashed #818cf8 !important;
}
.sortable-chosen {
    background-color: #f8fafc;
}
.dark .sortable-chosen {
    background-color: #1e293b;
}
.drag-handle {
    cursor: grab;
    touch-action: none;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Terminal phosphor font & styling */
.terminal-window {
    background-color: #0b1120;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
}
.terminal-output {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
}
.terminal-prompt {
    color: #38bdf8;
    font-weight: 600;
}
.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: #38bdf8;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Toast Notification animations */
.toast-enter {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-leave {
    animation: slideOutRight 0.25s ease-in forwards;
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Capsule style navigation */
.capsule-nav {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.capsule-nav.is-sticky {
    margin-top: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.dark .capsule-nav.is-sticky {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: rgba(51, 65, 85, 0.8);
}

/* =================================================== */
/* TinyMCE Full-Featured Editor Theme Harmonization    */
/* =================================================== */
.tox-tinymce {
    border-radius: 0.85rem !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    overflow: hidden !important;
}

.dark .tox-tinymce {
    border: 1px solid #334155 !important;
    background-color: #0f172a !important;
}

.tox-tinymce:focus-within {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}

/* Ensure Toolbars Always Wrap & Never Hide Tools Behind 3 Dots */
.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar__overflow {
    flex-wrap: wrap !important;
}

.tox .tox-toolbar__group {
    padding: 0 4px !important;
    flex-wrap: wrap !important;
}

.tox .tox-toolbar-overlord {
    border-bottom: 1px solid #f1f5f9 !important;
}

.dark .tox .tox-toolbar-overlord {
    border-bottom: 1px solid #1e293b !important;
}

/* TinyMCE Menubar Aesthetics */
.tox .tox-menubar {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 2px 6px !important;
}

.dark .tox .tox-menubar {
    border-bottom: 1px solid #1e293b !important;
    background-color: #0b1120 !important;
}

/* Ensure TinyMCE Popups, Modals, Menus appear above Tailwind Modals & Backdrops */
.tox-tinymce-aux,
.tox-dialog-wrap,
.tox-silver-sink,
.tox-pop {
    z-index: 99999 !important;
}

/* Statusbar styling */
.tox .tox-statusbar {
    border-top: 1px solid #f1f5f9 !important;
    font-size: 11px !important;
}

.dark .tox .tox-statusbar {
    border-top: 1px solid #1e293b !important;
    background-color: #0b1120 !important;
    color: #94a3b8 !important;
}

