/* SIMPLE SIDEBAR FIX */

/* Company Logo Styling */
.app-sidebar-logo img {
    border-radius: 0 !important; /* Remove any circular/square styling */
    object-fit: contain !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin-left: 20px !important; /* Move logo to the right */
}

.app-sidebar-logo .h-50px {
    height: 50px !important;
    width: auto !important;
    max-width: 200px !important; /* Limit maximum width */
}

/* Ensure logo displays properly in both light and dark themes */
.app-sidebar-logo .theme-light-show,
.app-sidebar-logo .theme-dark-show {
    border-radius: 0 !important;
    object-fit: contain !important;
}

/* Bigger font sizes */
.app-sidebar .menu-title {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
}

.app-sidebar .menu-heading {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

/* ONLY target the specific sidebar menu active items - very surgical approach */
/* Only apply to menu items WITHOUT submenus (no data-kt-menu-trigger) */
#kt_app_sidebar .app-sidebar-menu-primary.menu-state-bullet-primary .menu-item:not([data-kt-menu-trigger]) > .menu-link.active {
    background-color: var(--company-primary-color, #600AB6) !important;
    color: #ffffff !important;
    border-radius: 0.475rem !important;
}

#kt_app_sidebar .app-sidebar-menu-primary.menu-state-bullet-primary .menu-item:not([data-kt-menu-trigger]).here > .menu-link {
    background-color: var(--company-primary-color, #600AB6) !important;
    color: #ffffff !important;
    border-radius: 0.475rem !important;
}

#kt_app_sidebar .app-sidebar-menu-primary.menu-state-bullet-primary .menu-sub .menu-link.active {
    background-color: var(--company-primary-color, #600AB6) !important;
    color: #ffffff !important;
    border-radius: 0.475rem !important;
}

.app-sidebar .menu-item:not([data-kt-menu-trigger]).here > .menu-link .menu-icon,
.app-sidebar .menu-item:not([data-kt-menu-trigger]) > .menu-link.active .menu-icon,
.app-sidebar .menu-sub .menu-link.active .menu-icon,
.app-sidebar .menu-item:not([data-kt-menu-trigger]).here > .menu-link .menu-icon i,
.app-sidebar .menu-item:not([data-kt-menu-trigger]) > .menu-link.active .menu-icon i,
.app-sidebar .menu-sub .menu-link.active .menu-icon i {
    color: #ffffff !important;
}

/* Fix dropdown functionality - ensure sub-menus show when parent has 'show' class */
.app-sidebar .menu-item.show > .menu-sub-accordion {
    display: flex !important;
    flex-direction: column !important;
}

/* MODAL HORIZONTAL SCROLL FIX */
.modal-no-horizontal-scroll {
    overflow-x: hidden !important;
}

.modal-no-horizontal-scroll .modal-content {
    overflow-x: hidden !important;
}

.modal-no-horizontal-scroll .modal-body {
    overflow-x: hidden !important;
}

/* Reduce form input sizes and spacing */
.modal-no-horizontal-scroll .form-control,
.modal-no-horizontal-scroll .form-select {
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    min-width: 0 !important;
}

/* Reduce spacing between columns */
.modal-no-horizontal-scroll .row.g-3 {
    --bs-gutter-x: 0.75rem !important;
}

.modal-no-horizontal-scroll .col-md-6 {
    flex: 0 0 auto !important;
    width: calc(50% - 0.375rem) !important;
}

/* Reduce modal padding */
.modal-no-horizontal-scroll {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Eliminate Bootstrap row negative margins inside modals (root cause of horizontal scroll) */
.modal-no-horizontal-scroll .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure columns never overflow the container */
.modal-no-horizontal-scroll [class^="col-"],
.modal-no-horizontal-scroll [class*=" col-"] {
    max-width: 100% !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Defensive: any large components should not exceed container width */
.modal-no-horizontal-scroll .dropzone,
.modal-no-horizontal-scroll .image-input,
.modal-no-horizontal-scroll .modal-body > * {
    max-width: 100% !important;
}

/* Custom styling for View Details button */
.btn.btn-outline-custom {
    color: #1e1e2d !important;
    background-color: #ffffff !important;
    border: 2px dashed #1e1e2d !important;
    border-radius: 0.475rem;
    transition: all 0.3s ease;
}

.btn.btn-outline-custom i,
.btn.btn-outline-custom .svg-icon {
    color: #1e1e2d !important;
}

.btn.btn-outline-custom:hover,
.btn.btn-outline-custom:focus,
.btn.btn-outline-custom:active {
    color: #ffffff !important;
    background-color: #1e1e2d !important;
    border: 2px dashed #1e1e2d !important;
}

.btn.btn-outline-custom:hover i,
.btn.btn-outline-custom:hover .svg-icon,
.btn.btn-outline-custom:focus i,
.btn.btn-outline-custom:focus .svg-icon,
.btn.btn-outline-custom:active i,
.btn.btn-outline-custom:active .svg-icon {
    color: #ffffff !important;
}

/* Force company primary color on all primary buttons */
.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:hover {
    background-color: var(--company-primary-color, #600AB6) !important;
    border-color: var(--company-primary-color, #600AB6) !important;
    color: #ffffff !important;
}

/* Force company primary color on all primary button states */
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--company-primary-color, #600AB6) !important;
    border-color: var(--company-primary-color, #600AB6) !important;
    opacity: 0.65 !important;
}

/* Force company primary color on all info buttons (which might be used as primary) */
.btn-info,
.btn-info:focus,
.btn-info:active,
.btn-info:hover {
    background-color: var(--company-primary-color, #7239EA) !important;
    border-color: var(--company-primary-color, #7239EA) !important;
    color: #ffffff !important;
}

/* Force company primary color on all info button states */
.btn-info:disabled,
.btn-info.disabled {
    background-color: var(--company-primary-color, #7239EA) !important;
    border-color: var(--company-primary-color, #7239EA) !important;
    opacity: 0.65 !important;
}

/* Force company primary light color on all light color classes */
.bg-light-primary,
.bg-light-success,
.symbol-label.bg-light-primary,
.symbol-label.bg-light-success {
    background-color: var(--company-primary-light-color, #f1faff) !important;
}

/* Force company primary light color on hover states */
.bg-hover-light-primary:hover,
.bg-state-light-primary:hover,
.bg-state-light-primary.active {
    background-color: var(--company-primary-light-color, #f1faff) !important;
}

/* Force company primary light color on menu states */
.menu-show-bg-light-primary .menu-item.show > .menu-link,
.menu-here-bg-light-primary .menu-item.here > .menu-link,
.menu-hover-bg-light-primary .menu-item.hover:not(.here) > .menu-link:not(.disabled):not(.active):not(.here),
.menu-hover-bg-light-primary .menu-item:not(.here) .menu-link:hover:not(.disabled):not(.active):not(.here),
.menu-active-bg-light-primary .menu-item .menu-link.active,
.menu-state-bg-light-primary .menu-item.show > .menu-link,
.menu-state-bg-light-primary .menu-item.here > .menu-link,
.menu-state-bg-light-primary .menu-item.hover:not(.here) > .menu-link:not(.disabled):not(.active):not(.here),
.menu-state-bg-light-primary .menu-item:not(.here) .menu-link:hover:not(.disabled):not(.active):not(.here),
.menu-state-bg-light-primary .menu-item .menu-link.active {
    background-color: var(--company-primary-light-color, #f1faff) !important;
}

/* Special sidebar buttons styling */
.sidebar-special-button {
    border-radius: 8px !important;
    margin: 1px 0 !important;
    transition: all 0.3s ease !important;
}

/* Account Settings Button */
.account-settings-button {
    background-color: #000000 !important; /* Black background by default */
    border: none !important; /* Completely remove any border */
    border-radius: 8px !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
}

.account-settings-button .menu-icon {
    color: #ffffff !important; /* White icon always */
}

.account-settings-button .menu-title {
    color: #ffffff !important; /* White text always */
}

.account-settings-button:hover {
    /* Keep black background on hover */
    color: #ffffff !important;
    border: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.account-settings-button:hover .menu-icon {
    color: #ffffff !important;
}

.account-settings-button:hover .menu-title {
    color: #ffffff !important;
}

/* Enhanced active state with company primary color */
.account-settings-button.active,
.account-settings-button.here,
.account-settings-button.menu-link.active,
.account-settings-button.menu-link.here {
    background-color: var(--company-primary-color, #600AB6) !important; /* Primary background when active */
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(96, 10, 182, 0.3) !important;
    transform: translateY(-2px) !important;
}

.account-settings-button.active .menu-icon,
.account-settings-button.here .menu-icon,
.account-settings-button.menu-link.active .menu-icon,
.account-settings-button.menu-link.here .menu-icon {
    color: #ffffff !important;
}

.account-settings-button.active .menu-title,
.account-settings-button.here .menu-title,
.account-settings-button.menu-link.active .menu-title,
.account-settings-button.menu-link.here .menu-title {
    color: #ffffff !important;
}

/* New Account Settings Button with exact HTML structure */
[data-account-settings="true"] {
    background-color: #000000 !important; /* Black background by default */
    border: none !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
}

[data-account-settings="true"]:hover {
    background-color: #000000 !important; /* Keep black background on hover */
    color: #ffffff !important;
    border: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Enhanced active state with company primary color for data attribute selector */
[data-account-settings="true"].active,
[data-account-settings="true"].here,
[data-account-settings="true"].menu-link.active,
[data-account-settings="true"].menu-link.here {
    background-color: var(--company-primary-color, #600AB6) !important; /* Primary background when active */
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(96, 10, 182, 0.3) !important;
    transform: translateY(-2px) !important;
}

[data-account-settings="true"] .menu-icon {
    color: #ffffff !important;
}

[data-account-settings="true"] .menu-title {
    color: #ffffff !important;
}

/* Ensure icon and title stay white in active state for data attribute selector */
[data-account-settings="true"].active .menu-icon,
[data-account-settings="true"].here .menu-icon,
[data-account-settings="true"].menu-link.active .menu-icon,
[data-account-settings="true"].menu-link.here .menu-icon {
    color: #ffffff !important;
}

[data-account-settings="true"].active .menu-title,
[data-account-settings="true"].here .menu-title,
[data-account-settings="true"].menu-link.active .menu-title,
[data-account-settings="true"].menu-link.here .menu-title {
    color: #ffffff !important;
}

/* Settings Cards - No borders by default, only primary border on hover */
.settings-card {
    border: 2px solid transparent !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.settings-card:hover {
    border-color: var(--company-primary-color, #600AB6) !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 30px rgba(96, 10, 182, 0.15) !important;
}

/* API Documentation Button */
.api-docs-button {
    border: 2px dashed #3F4254 !important; /* Restore dotted border for API docs */
    background-color: transparent !important;
    color: #3F4254 !important;
    border-color: #3F4254 !important;
}

.api-docs-button:hover {
    background-color: var(--company-primary-light-color, #f1faff) !important;
    color: #3F4254 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(96, 10, 182, 0.2) !important;
}

.api-docs-button.active {
    background-color: var(--company-primary-light-color, #f1faff) !important;
    color: #3F4254 !important;
    border-color: #3F4254 !important;
    box-shadow: 0 4px 12px rgba(96, 10, 182, 0.2) !important;
}

/* Icon styling for special buttons */
.sidebar-special-button .menu-icon {
    color: inherit !important;
}

.sidebar-special-button .menu-icon i {
    color: inherit !important;
}

.sidebar-special-button .menu-title {
    color: inherit !important;
    font-weight: 600 !important;
}