/* Modal Enhancements - Notification and Profile Dropdowns */

/* ===== NOTIFICATION MODAL ===== */
.notification-dropdown {
    position: relative;
    z-index: 1050;
    overflow: visible !important;
}

.notification-dropdown .dropdown-menu {
    z-index: 1051;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 420px;
    max-width: 420px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: visible !important;
}

.notification-dropdown .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force show notification dropdown when active */
.notification-dropdown.show .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Ensure notification dropdown menu is visible when shown */
.notification-dropdown .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    max-width: 400px !important;
    width: 400px !important;
}

/* Prevent horizontal scrolling in notification container */
.notifications-container {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
}

/* Ensure notification items don't overflow */
.notification-item {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.notification-content {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Hide notification count number, only show red dot */
.notification-count {
    display: none !important;
}

/* Ensure red dot is visible */
.icon-dot.has-notifications {
    background: #dc3545 !important;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7) !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
}

/* Force show all dropdown menus when they have the show class */
.dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure notification button is clickable */
.notification-btn {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Ensure notification bell icon remains visible when active */
.notification-btn:active i,
.notification-btn.active i,
.notification-btn.show i,
.notification-bell-btn:active i,
.notification-bell-btn.active i,
.notification-bell-btn.show i,
.notification-dropdown.show .notification-btn i,
.notification-dropdown.show .notification-bell-btn i,
.notification-dropdown.active .notification-btn i,
.notification-dropdown.active .notification-bell-btn i {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure background doesn't turn white when active or dropdown is shown */
.notification-btn:active,
.notification-btn.active,
.notification-btn.show,
.notification-btn:hover,
.notification-bell-btn:active,
.notification-bell-btn.active,
.notification-bell-btn.show,
.notification-bell-btn:hover,
.btn.notification-bell-btn:active,
.btn.notification-bell-btn.active,
.btn.notification-bell-btn.show,
.btn.notification-bell-btn:hover,
button.notification-bell-btn:active,
button.notification-bell-btn:hover,
.notification-dropdown.show .notification-btn,
.notification-dropdown.show .notification-bell-btn,
.notification-dropdown.active .notification-btn,
.notification-dropdown.active .notification-bell-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Ensure notification dropdown is properly positioned */
.notification-dropdown {
    position: relative !important;
    z-index: 1050 !important;
}

.notification-btn {
    position: relative;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    transform: translateY(-2px);
}

.icon-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.icon-dot.has-notifications {
    background: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

.notification-count {
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

.notification-modal {
    animation: slideInDown 0.3s ease-out;
    transform-origin: top right;
}

.notification-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    position: relative;
    overflow: hidden;
}

.notification-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.notification-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.notification-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.notification-item:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-left-color: #3b82f6;
    transform: translateX(5px);
}

.notification-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.notification-icon-wrapper {
    position: relative;
}

.notification-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #dc3545;
    border-radius: 50%;
    animation: notificationPulse 2s infinite;
}

.notification-dot {
    width: 8px;
    height: 8px;
    animation: blink 1.5s infinite;
}

.notification-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.notification-item:hover .notification-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-type-badge {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.empty-notifications {
    padding: 3rem 2rem;
    text-align: center;
}

.empty-notification-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #6c757d;
    animation: float 3s ease-in-out infinite;
}

.empty-notifications .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.empty-notifications .btn-primary {
    background: #0d6efd;
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.empty-notifications .btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    color: #ffffff;
}

.empty-notifications .btn-primary:active,
.empty-notifications .btn-primary:focus {
    background: #0d6efd;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.notification-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.notification-view-all-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    transition: all 0.3s ease;
}

.notification-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== PROFILE MODAL ===== */
.profile-dropdown {
    position: relative;
}

.profile-btn {
    transition: all 0.3s ease;
}

.profile-btn:hover {
    transform: translateY(-2px);
}

/* Modern Professional Avatar Styling - Updated for consistency */
.profile-avatar-wrapper {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border-radius: 50%;
    padding: 0;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: 44px !important;
    height: 44px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-wrapper:hover,
.profile-avatar-wrapper:active,
.profile-avatar-wrapper:focus {
    transform: translateY(-2px) scale(1.05);
    background: transparent !important;
    background-color: transparent !important;
}

.profile-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-wrapper:hover .profile-avatar {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.profile-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
    animation: statusPulse 2s infinite;
}

.profile-status-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(25, 135, 84, 0.6), 0 0 0 2px rgba(25, 135, 84, 0.2);
    }
    100% {
        box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
    }
}

/* Default Avatar Placeholder Styling - Modern Government App Design */
.profile-avatar.default-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #156daf 0%, #23ace5 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.profile-avatar.default-avatar .avatar-initials {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Large Default Avatar for Dropdown */
.default-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd !important;
    border: 3px solid #e5e7eb;
    font-weight: 700;
    font-size: 28px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.default-avatar-large .avatar-initials-large {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Subtle pattern overlay for default avatars - DISABLED for solid colors */
.profile-avatar.default-avatar::before,
.default-avatar-large::before {
    display: none !important;
}

.profile-modal,
.header-dropdown-menu.profile-modal,
.dropdown-menu.profile-modal {
    animation: slideInDown 0.3s ease-out;
    transform-origin: top right;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    z-index: 1050 !important;
    transform: none !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    border-radius: 12px !important;
    overflow: visible !important;
}

/* Ensure all child elements respect rounded corners */
.profile-modal > *:first-child {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.profile-modal > *:last-child {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

/* Ensure profile header has rounded top corners */
.profile-header {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

/* Ensure profile footer has rounded bottom corners */
.profile-footer {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

/* Override any stisla theme background colors */
.dropdown-menu.profile-modal,
.header-dropdown-menu.profile-modal,
.navbar-nav .profile-dropdown .profile-modal,
.app-header .profile-dropdown .profile-modal {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Ensure profile dropdown container is positioned correctly */
.profile-dropdown,
.pe-dropdown-mega.profile-dropdown {
    position: relative !important;
    display: inline-block !important;
}

.profile-dropdown .dropdown-menu,
.profile-dropdown .profile-modal,
.profile-dropdown .header-dropdown-menu,
.pe-dropdown-mega.profile-dropdown .dropdown-menu,
.pe-dropdown-mega.profile-dropdown .profile-modal,
.pe-dropdown-mega.profile-dropdown .header-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    z-index: 1050 !important;
    transform: none !important;
    display: none !important;
}

.profile-dropdown .dropdown-menu.show,
.profile-dropdown .profile-modal.show,
.profile-dropdown .header-dropdown-menu.show,
.pe-dropdown-mega.profile-dropdown .dropdown-menu.show,
.pe-dropdown-mega.profile-dropdown .profile-modal.show,
.pe-dropdown-mega.profile-dropdown .header-dropdown-menu.show {
    display: block !important;
}

/* Bootstrap dropdown-menu-end positioning fix */
.dropdown-menu-end,
.profile-dropdown .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
    margin-left: 0 !important;
}

/* Override any conflicting styles from stisla theme and style.css */
.navbar-nav .profile-dropdown .dropdown-menu,
.navbar-nav .profile-dropdown .profile-modal,
.navbar-nav .profile-dropdown .header-dropdown-menu,
.app-header .profile-dropdown .dropdown-menu,
.app-header .profile-dropdown .profile-modal,
.app-header .profile-dropdown .header-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    z-index: 1050 !important;
    transform: none !important;
}

/* Override style.css conflicting rule */
.navbar-nav .profile-dropdown .dropdown-menu,
.app-header .profile-dropdown .dropdown-menu {
    margin-top: 0.5rem !important;
}

/* Ensure dropdown doesn't go off-screen on small viewports */
@media (max-width: 576px) {
    .profile-dropdown .dropdown-menu,
    .profile-dropdown .profile-modal,
    .profile-dropdown .header-dropdown-menu {
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 2rem) !important;
    }
}

.profile-header {
    background: #ffffff !important;
    position: relative;
    overflow: hidden;
    padding: 1.5rem !important;
}

.profile-header::before {
    display: none !important;
}

/* Profile header text colors - dark for white background */
.profile-header .profile-name {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.profile-header .profile-email {
    color: #6c757d !important;
}

.profile-header small {
    color: #6c757d !important;
}

.profile-avatar-large {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: #0d6efd !important;
    border: 3px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.profile-avatar-large::before {
    display: none !important;
}

.profile-avatar-large:hover::before {
    display: none !important;
}

        /* Status indicator for large avatar - Updated styling */
        .profile-avatar-large .profile-status-online {
            position: absolute !important;
            bottom: -2px !important;
            right: -2px !important;
            width: 20px !important;
            height: 20px !important;
            background: #28a745 !important;
            border: 2px solid #ffffff !important;
            border-radius: 50% !important;
            box-shadow: 0 0 0 2px #28a745, 0 2px 8px rgba(40, 167, 69, 0.8) !important;
            z-index: 2147483647 !important;
            animation: none !important;
            opacity: 1 !important;
        }

.profile-avatar-wrapper .profile-status-indicator {
    position: absolute !important;
    bottom: -2px !important;
    right: -2px !important;
    width: 18px !important;
    height: 18px !important;
    background: #28a745 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #28a745, 0 2px 8px rgba(40, 167, 69, 0.8) !important;
    z-index: 2147483647 !important;
    animation: none !important;
    opacity: 1 !important;
}

.theme-switcher-section {
    transition: all 0.3s ease;
}

.theme-icon {
    color: #0d6efd !important;
    font-size: 1.1rem;
}

.profile-actions {
    background: #ffffff !important;
}

.profile-action-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.profile-action-item:last-child {
    border-bottom: none;
}

.profile-action-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-action-link::before {
    display: none !important;
}

.profile-action-link:hover::before {
    display: none !important;
}

.profile-action-link:hover {
    background: rgba(13, 110, 253, 0.08) !important;
    color: #0d6efd !important;
    transform: translateX(5px);
}

.action-icon-wrapper {
    width: 40px;
    height: 40px;
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    transition: all 0.3s ease;
    color: #6c757d;
}

.profile-action-link:hover .action-icon-wrapper {
    background: transparent !important;
    background-color: transparent !important;
    color: #0d6efd !important;
    transform: scale(1.1);
}

.action-content {
    flex: 1;
}

.action-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.action-subtitle {
    display: block;
    color: #6c757d;
    font-size: 0.75rem;
}

.action-arrow {
    color: #6c757d;
    transition: all 0.3s ease;
}

.profile-action-link:hover .action-arrow {
    color: #0d6efd !important;
    transform: translateX(3px);
}

.profile-footer {
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 1rem 1.5rem !important;
}

.sign-out-btn,
.btn-outline-danger.sign-out-btn,
.profile-dropdown .sign-out-btn,
.profile-dropdown .btn-outline-danger.sign-out-btn,
.profile-modal .sign-out-btn,
.profile-modal .btn-outline-danger.sign-out-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sign-out-btn:hover,
.btn-outline-danger.sign-out-btn:hover,
.profile-dropdown .sign-out-btn:hover,
.profile-dropdown .btn-outline-danger.sign-out-btn:hover,
.profile-modal .sign-out-btn:hover,
.profile-modal .btn-outline-danger.sign-out-btn:hover {
    background: #dc3545 !important;
    background-color: #dc3545 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    color: #ffffff !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside logout button is white on hover */
.sign-out-btn:hover i,
.sign-out-btn:hover i.fas,
.sign-out-btn:hover i.far,
.btn-outline-danger.sign-out-btn:hover i,
.btn-outline-danger.sign-out-btn:hover i.fas,
.btn-outline-danger.sign-out-btn:hover i.far,
.profile-dropdown .sign-out-btn:hover i,
.profile-dropdown .sign-out-btn:hover i.fas,
.profile-dropdown .sign-out-btn:hover i.far,
.profile-dropdown .btn-outline-danger.sign-out-btn:hover i,
.profile-dropdown .btn-outline-danger.sign-out-btn:hover i.fas,
.profile-dropdown .btn-outline-danger.sign-out-btn:hover i.far,
.profile-modal .sign-out-btn:hover i,
.profile-modal .sign-out-btn:hover i.fas,
.profile-modal .sign-out-btn:hover i.far,
.profile-modal .btn-outline-danger.sign-out-btn:hover i,
.profile-modal .btn-outline-danger.sign-out-btn:hover i.fas,
.profile-modal .btn-outline-danger.sign-out-btn:hover i.far {
    color: #ffffff !important;
}

/* Ensure icon inherits button color on hover */
.sign-out-btn:hover *,
.btn-outline-danger.sign-out-btn:hover *,
.profile-dropdown .sign-out-btn:hover *,
.profile-dropdown .btn-outline-danger.sign-out-btn:hover *,
.profile-modal .sign-out-btn:hover *,
.profile-modal .btn-outline-danger.sign-out-btn:hover * {
    color: #ffffff !important;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes notificationPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .notification-modal {
        width: 90vw !important;
        max-width: 400px;
        margin: 0 auto;
    }

    .profile-modal {
        width: 90vw !important;
        max-width: 320px;
        margin: 0 auto;
    }

    .notification-header,
    .profile-header {
        padding: 1rem;
    }

    .notification-item,
    .profile-action-link {
        padding: 0.75rem 1rem;
    }
}

/* ===== DARK MODE SUPPORT ===== */
[data-bs-theme="dark"] .notification-modal,
[data-bs-theme="dark"] .profile-modal {
    background: #2d3748;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .notification-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(45, 55, 72, 0.8) 100%);
}

[data-bs-theme="dark"] .profile-action-link {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .profile-action-link:hover {
    background: rgba(13, 110, 253, 0.1) !important;
}

[data-bs-theme="dark"] .action-icon-wrapper {
    background: transparent !important;
    background-color: transparent !important;
    color: #a0aec0;
}

[data-bs-theme="dark"] .profile-action-link:hover .action-icon-wrapper {
    background: transparent !important;
    background-color: transparent !important;
    color: #0d6efd !important;
}

[data-bs-theme="dark"] .notification-content,
[data-bs-theme="dark"] .profile-footer {
    background: #4a5568 !important;
}

/* ===== ACCESSIBILITY ===== */
.notification-btn:focus,
.profile-btn:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px;
}

.profile-action-link:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: -2px;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.notification-modal,
.profile-modal {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.notification-item,
.profile-action-item {
    will-change: transform;
}

/* ===== THEME SWITCHER ENHANCEMENTS ===== */
.theme-switch-wrapper {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: 0.3s;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch-label::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch:checked + .theme-switch-label {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.theme-switch:checked + .theme-switch-label::before {
    transform: translateX(26px);
}

.theme-icon-light,
.theme-icon-dark {
    font-size: 10px;
    color: white;
    z-index: 1;
    transition: all 0.3s ease;
}

.theme-icon-light {
    margin-left: 4px;
}

.theme-icon-dark {
    margin-right: 4px;
}

.theme-switch:checked ~ .theme-icon-light {
    opacity: 0.5;
}

.theme-switch:not(:checked) ~ .theme-icon-dark {
    opacity: 0.5;
}

/* ===== LOADING STATES ===== */
.notification-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.notification-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MICRO-INTERACTIONS ===== */
.notification-action-btn,
.profile-action-link {
    position: relative;
    overflow: hidden;
}

.notification-action-btn::after,
.profile-action-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.notification-action-btn:active::after,
.profile-action-link:active::after {
    width: 100px;
    height: 100px;
}

/* Card dark mode support */
.card-dark-bg {
  background: white;
}
.card-dark-text {
  color: inherit;
}
[data-bs-theme="dark"] .card-dark-bg {
  background: #23272f !important;
}
[data-bs-theme="dark"] .card-dark-text {
  color: #f8f9fa !important;
}

.app-wrapper {
  background: #ebecf0;
}
[data-bs-theme="dark"] .app-wrapper {
  background: #181c23;
}

/* ===== GLOBAL MODAL FIXES - Ensure modals appear above navbars ===== */
/* Bootstrap modals should appear above all navbars */
.modal {
    z-index: 2000 !important; /* Higher than navbar z-index to ensure visibility */
}

.modal-backdrop {
    z-index: 1999 !important; /* Below modal but above navbar */
}

/* Ensure modal dialogs are properly centered and not cut by navbar */
/* Only apply margin-top to modals without any inline style attribute to preserve manual margins */
.modal-dialog:not([style]) {
    margin: 1.75rem auto !important;
    margin-top: max(1.75rem, 80px) !important; /* Account for navbar height (70px) + extra spacing */
}

/* For modals with inline styles, ensure they at least have proper z-index and positioning */
.modal-dialog[style] {
    /* Preserve inline styles but ensure modal appears above navbar via z-index */
    /* Inline margin values will be respected */
}

/* Ensure modals are properly positioned on mobile */
@media (max-width: 575.98px) {
    .modal-dialog:not([style]) {
        margin: 0.5rem !important;
        margin-top: max(0.5rem, 80px) !important;
    }
}

/* Fix for all navbar types - ensure they're below modals */
.navbar,
.main-navbar,
.app-header,
.navbar-bg {
    z-index: 1100 !important; /* Below modals (2000) */
}

/* Ensure sidebar doesn't interfere with modals */
.main-sidebar,
.pe-app-sidebar {
    z-index: 1050 !important; /* Below modals and navbar */
}

/* Ensure modal content and body properly contain all content */
.modal-content {
    overflow: visible !important;
    position: relative !important;
}

.modal-body {
    overflow: visible !important;
    position: relative !important;
    min-height: auto !important;
}

/* Ensure form-check elements stay within modal */
.modal-body .form-check {
    position: relative !important;
    z-index: 1 !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    /* Ensure proper left padding to align with modal border */
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.modal-body .form-check-input {
    position: relative !important;
    z-index: 1 !important;
    float: none !important;
    margin-top: 0.25rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.75rem !important;
}

.modal-body .form-check-label {
    position: relative !important;
    z-index: 1 !important;
    display: inline-block !important;
    flex: 1 !important;
    word-wrap: break-word !important;
    padding-top: 0.125rem !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
}
