/* Sneat Layout Compatibility CSS */

/* App Brand Styling */
.app-brand {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(67, 89, 113, 0.1);
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.app-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.app-brand-logo svg {
    width: 100%;
    height: 100%;
    color: var(--bs-primary, #696cff);
}

.app-brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-heading-color, #384551) !important;
    white-space: nowrap;
    margin-left: 0.75rem;
    display: inline-block;
    opacity: 1 !important;
    visibility: visible !important;
}

.app-brand-text span {
    display: inline;
}

.app-brand-text .text-primary {
    color: var(--bs-primary, #696cff) !important;
}

[data-theme="dark"] .app-brand {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .app-brand-text {
    color: var(--bs-emphasis-color, #fff) !important;
}

[data-theme="dark"] .app-brand-logo svg {
    color: var(--bs-primary, #696cff);
}

/* Ensure Sneat menu icons are properly styled */
.menu-icon {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

/* Active menu item styling */
.menu-item.active > .menu-link {
    background-color: rgba(105, 108, 255, 0.1);
    color: #696cff;
}

.menu-item.active > .menu-link .menu-icon {
    color: #696cff;
}

/* Menu link hover */
.menu-link:hover {
    background-color: rgba(105, 108, 255, 0.05);
}

/* Logout button styling */
.logout-form .menu-link {
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.logout-form .menu-link:hover {
    background-color: rgba(255, 62, 29, 0.1);
    color: #ff3e1d;
}

/* Theme compatibility for menu */
html[data-theme="dark"] .bg-menu-theme,
[data-theme="dark"] .bg-menu-theme,
html[data-theme="dark"] .layout-menu,
[data-theme="dark"] .layout-menu,
html[data-theme="dark"] .menu-vertical,
[data-theme="dark"] .menu-vertical {
    background-color: var(--sidebar-bg, #0F172A) !important;
    color: var(--sidebar-text, #F8FAFC) !important;
}

html[data-theme="dark"] .menu-link,
[data-theme="dark"] .menu-link {
    color: var(--sidebar-text, #F8FAFC) !important;
}

html[data-theme="dark"] .menu-link:hover,
[data-theme="dark"] .menu-link:hover {
    background-color: var(--hover-bg, rgba(255, 255, 255, 0.05)) !important;
    color: var(--primary-light, #818CF8) !important;
}

[data-theme="dark"] .menu-item.active > .menu-link,
html[data-theme="dark"] .menu-item.active > .menu-link {
    background-color: rgba(105, 108, 255, 0.2) !important;
    color: var(--primary-light, #818CF8) !important;
}

html[data-theme="dark"] .menu-header,
[data-theme="dark"] .menu-header {
    color: var(--sidebar-text, #F8FAFC) !important;
    opacity: 0.7;
}

html[data-theme="dark"] .menu-icon,
[data-theme="dark"] .menu-icon {
    color: var(--sidebar-text, #F8FAFC) !important;
}

html[data-theme="dark"] .menu-link:hover .menu-icon,
[data-theme="dark"] .menu-link:hover .menu-icon {
    color: var(--primary-light, #818CF8) !important;
}

/* Navbar search input styling */
.navbar-nav .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
}

.navbar-nav .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(105, 108, 255, 0.5);
    color: inherit;
}

[data-theme="dark"] .navbar-nav .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #bdc1c5;
}

[data-theme="dark"] .navbar-nav .form-control:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(105, 108, 255, 0.5);
    color: #bdc1c5;
}

/* Avatar styling */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Content wrapper adjustments */
.content-wrapper {
    min-height: calc(100vh - 4rem);
}

.container-p-y {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* Footer styling */
.content-footer {
    border-top: 1px solid rgba(67, 89, 113, 0.1);
    padding: 1rem 0;
}

.footer-link {
    color: #8592a3;
    text-decoration: none;
    margin-right: 1rem;
}

.footer-link:hover {
    color: #696cff;
}

[data-theme="dark"] .footer-link {
    color: #a7acb2;
}

[data-theme="dark"] .footer-link:hover {
    color: #a5a7ff;
}

/* Ensure proper spacing in content area */
.container-xxl {
    max-width: 1400px;
}

/* Mobile menu toggle compatibility */
@media (max-width: 1199.98px) {
    .layout-menu-toggle {
        display: block;
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Ensure modals work properly */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

/* Badge notifications */
.badge-notifications {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

/* Dropdown menu styling */
.dropdown-menu {
    border: 1px solid rgba(67, 89, 113, 0.1);
    box-shadow: 0 0.25rem 1rem rgba(34, 48, 62, 0.1);
}

[data-theme="dark"] .dropdown-menu {
    background-color: #fff !important;
    border-color: rgba(67, 89, 113, 0.1) !important;
    color: var(--bs-body-color) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--bs-body-color) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(105, 108, 255, 0.08) !important;
    color: var(--bs-body-color) !important;
}

/* Ensure dropdowns are properly positioned */
.navbar-dropdown.dropdown {
    position: relative;
}

.navbar-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    min-width: 12rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background-color: #fff;
    border: 1px solid rgba(67, 89, 113, 0.1);
    box-shadow: 0 0.25rem 1rem rgba(34, 48, 62, 0.1);
    border-radius: 0.375rem;
    display: none;
}

/* Show dropdown when Bootstrap adds .show class */
.navbar-dropdown .dropdown-menu.show {
    display: block !important;
}

/* Ensure dropdown is visible when parent has .show */
.navbar-dropdown.dropdown.show .dropdown-menu,
.navbar-dropdown .dropdown-toggle.show + .dropdown-menu {
    display: block !important;
}

/* Language dropdown specific styling */
.language-form {
    width: 100%;
}

.language-option {
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0.625rem 1rem;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.language-option:hover {
    background-color: rgba(105, 108, 255, 0.08);
    color: var(--bs-body-color);
}

.language-option.active {
    background-color: rgba(105, 108, 255, 0.1);
    color: var(--bs-primary);
    font-weight: 500;
}

.language-option i {
    width: 1.5rem;
    font-size: 1rem;
    color: var(--bs-text-muted);
}

.language-option.active i {
    color: var(--bs-primary);
}

.language-option:hover i {
    color: var(--bs-primary);
}

/* Notification badge positioning */
.badge-notifications {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Avatar styling in navbar */
.navbar .avatar {
    width: 2.5rem;
    height: 2.5rem;
}

.navbar .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar .avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Navbar link styling */
.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.navbar-nav .nav-link.hide-arrow::after {
    display: none;
}

/* User dropdown menu styling */
.navbar-dropdown.dropdown-user .dropdown-menu {
    min-width: 14rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-user .dropdown-item {
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    color: var(--bs-body-color);
    transition: background-color 0.2s ease;
}

.dropdown-user .dropdown-item:hover {
    background-color: rgba(105, 108, 255, 0.08);
    color: var(--bs-body-color);
}

.dropdown-user .dropdown-item i {
    width: 1.5rem;
    font-size: 1rem;
    color: var(--bs-text-muted);
}

.dropdown-user .dropdown-item:hover i {
    color: var(--bs-primary);
}

/* Badge in dropdown items */
.dropdown-item .badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0;
    min-width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.dropdown-item {
    position: relative;
}

/* Avatar in dropdown header */
.dropdown-user .dropdown-item .avatar {
    width: 2.5rem;
    height: 2.5rem;
}

.dropdown-user .dropdown-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-user .dropdown-item .avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* User info in dropdown header */
.dropdown-user .dropdown-item .fw-semibold {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    line-height: 1.4;
}

.dropdown-user .dropdown-item .text-muted {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
}

[data-theme="dark"] .dropdown-user .dropdown-item {
    color: var(--bs-body-color);
}

[data-theme="dark"] .dropdown-user .dropdown-item:hover {
    background-color: rgba(105, 108, 255, 0.15);
}

/* Language and theme selectors in navbar */
.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

/* Ensure proper z-index for overlays */
.layout-overlay {
    z-index: 1030;
}

.content-backdrop {
    z-index: 1029;
}

/* Menu header text styling */
.menu-header {
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8592a3;
}

[data-theme="dark"] .menu-header {
    color: #a7acb2;
}

/* Ensure menu items have proper spacing */
.menu-item {
    margin-bottom: 0.125rem;
}

/* Search form positioning */
.navbar-nav .form-control {
    min-width: 200px;
    max-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .navbar-nav .form-control {
        min-width: 150px;
        max-width: 200px;
    }
    
    .container-p-y {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}
