/* Reset body and html to prevent white space */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

[x-cloak] { 
    display: none !important; 
}

/* Sidebar improvements */
.sidebar-menu-item {
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.sidebar-menu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid #60a5fa;
}

/* Popover dropdowns */
.sidebar-popover {
    position: static;
}

/* Ensure popovers appear outside sidebar */
.sidebar-popover-desktop {
    position: fixed !important;
    z-index: 30 !important; /* Above sidebar (z-10) but below header (z-20) */
    pointer-events: auto !important;
    margin-left: 0 !important;
    left: 264px !important; /* Force position to right of sidebar */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 400px; /* Master Data dropdown height */
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    overscroll-behavior: contain;
}

/* Hide popovers on mobile */
@media (max-width: 1023px) {
    .sidebar-popover-desktop {
        display: none !important;
    }
}

/* Sidebar scrollbar styling */
.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Master Data popover scrollbar */
.sidebar-popover-desktop::-webkit-scrollbar {
    width: 10px;
}

.sidebar-popover-desktop::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.sidebar-popover-desktop::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.sidebar-popover-desktop::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar width fix */
.sidebar-fixed-width {
    width: 256px !important;
}

/* Hidden elements */
.hidden-important {
    display: none !important;
}

/* Enhanced SmartWizard Styling */
#smartwizard {
    position: relative;
    z-index: 1;
}

#smartwizard .nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

#smartwizard .nav-item {
    margin: 0;
    padding: 0;
}

#smartwizard .nav {
    position: relative;
    z-index: 10;
    height: 35px;
}

#smartwizard .nav-link {
    position: relative;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    margin-right: 0.5rem;
    border-bottom: 2px solid transparent;
    background: transparent;
}

#smartwizard .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

#smartwizard .nav-link.active {
    border-bottom-color: #2563eb !important;
    color: #2563eb !important;
    background-color: white;
    font-weight: 600;
}

#smartwizard .nav-link:not(.active) {
    color: #6b7280;
}

#smartwizard .nav-link:not(.active):hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

#smartwizard .nav-link.active span {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: #2563eb !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
}

#smartwizard .nav-link.done {
    color: #059669 !important;
}

#smartwizard .nav-link.done:not(.active) {
    background: transparent;
}

#smartwizard .nav-link.done span {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #10b981 !important;
    color: white !important;
}

#smartwizard .nav-link.done.active span {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: #2563eb !important;
}

#smartwizard .nav-link span {
    transition: all 0.3s ease;
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    max-width: 2.5rem !important;
    max-height: 2.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.75rem;
    border: 2px solid;
    box-sizing: border-box;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    overflow: hidden !important;
}

#smartwizard .nav-link span i {
    font-size: 0.875rem !important;
    line-height: 1 !important;
}

#smartwizard .tab-content {
    min-height: 400px;
    animation: fadeIn 0.3s ease-in;
}

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

#smartwizard .sw-btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

#smartwizard .sw-btn-next,
#smartwizard .sw-btn-prev,
#smartwizard .sw-btn-finish {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#smartwizard .sw-btn-next:hover,
#smartwizard .sw-btn-finish:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#smartwizard .sw-btn-prev:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Progress indicator */
.wizard-progress {
    height: 4px;
    background: #e5e7eb;
    position: relative;
    margin-bottom: 1rem;
}

.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* Select2 styling to match Tailwind */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 42px;
    height: 42px;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    padding: 0;
    background-color: white;
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: 48px !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    line-height: 1.5;
    color: #374151;
    display: flex;
    align-items: center;
    height: 100%;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.75rem;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.select2-results__option {
    padding: 0.5rem 0.75rem;
}

.select2-results__option--highlighted {
    background-color: #2563eb !important;
    color: white !important;
}

/* Select2 special width classes */
.select2-width-200 {
    width: 200px !important;
}

.select2-width-300 {
    width: 300px !important;
}

