/*
 * Mehr Guard Shared UI Component Styles
 * Styles for profile dropdowns, notifications, modals, and toasts
 */

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR SHARED UI
   ========================================================================== */
[data-theme="light"] .profile-dropdown,
[data-theme="light"] .notification-dropdown,
[data-theme="light"] .shared-modal {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .profile-dropdown-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(139, 92, 246, 0.02));
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .profile-info h4,
[data-theme="light"] .notification-header h4,
[data-theme="light"] .shared-modal-header h3 {
    color: #0f172a;
}

[data-theme="light"] .profile-stats,
[data-theme="light"] .notification-header,
[data-theme="light"] .shared-modal-header,
[data-theme="light"] .shared-modal-footer {
    border-color: #e2e8f0;
}

[data-theme="light"] .profile-action:hover,
[data-theme="light"] .notification-item:hover {
    background-color: #f1f5f9;
}

[data-theme="light"] .profile-dropdown-footer {
    background-color: #f8fafc;
}

[data-theme="light"] .stat-value,
[data-theme="light"] .notification-content h5 {
    color: #0f172a;
}

[data-theme="light"] .shared-toast {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .shared-toast .toast-message {
    color: #0f172a;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .setting-select {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .settings-card {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .setting-row {
    border-bottom-color: #f1f5f9;
}

[data-theme="light"] .setting-label {
    color: #0f172a;
}

[data-theme="light"] .user-profile .user-name {
    color: #0f172a;
}

/* ==========================================================================
   SIDEBAR USER PROFILE (Consistent across all pages)
   ========================================================================== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(25, 93, 230, 0.05);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.user-profile:hover {
    background-color: rgba(25, 93, 230, 0.12);
}

.user-profile .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #195de6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-profile .user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-profile .user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    display: block;
    line-height: 1.2;
}

.user-profile .user-role,
.user-profile .user-plan {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    line-height: 1.2;
}

.user-profile>.material-symbols-outlined {
    color: #64748b;
    font-size: 20px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.user-profile:hover>.material-symbols-outlined {
    transform: rotate(180deg);
}

/* ==========================================================================
   PROFILE DROPDOWN
   ========================================================================== */
.profile-dropdown {
    position: fixed;
    z-index: 1000;
    width: 20rem;
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.profile-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
}

.profile-dropdown-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(25, 93, 230, 0.1), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid #292e38;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #195de6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.profile-info p {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.profile-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: rgba(25, 93, 230, 0.15);
    color: #548bf7;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid #292e38;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 0.625rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-dropdown-actions {
    padding: 0.5rem;
}

.profile-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-align: left;
}

.profile-action:hover {
    background-color: #21262d;
    color: #ffffff;
}

.profile-action .material-symbols-outlined {
    font-size: 20px;
}

.profile-dropdown-footer {
    padding: 0.75rem 1rem;
    background-color: #111318;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offline-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #10b981;
}

.offline-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.version-text {
    font-size: 0.75rem;
    color: #64748b;
}

/* ==========================================================================
   NOTIFICATION DROPDOWN
   ========================================================================== */
.notification-dropdown {
    position: fixed;
    z-index: 1000;
    width: 22rem;
    max-height: 28rem;
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #292e38;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
}

.mark-all-read {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    color: #195de6;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mark-all-read:hover {
    color: #548bf7;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    max-height: 20rem;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(41, 46, 56, 0.5);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background-color: #21262d;
}

.notification-item.unread {
    background-color: rgba(25, 93, 230, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #195de6;
    border-radius: 0 2px 2px 0;
}

.notification-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-icon .material-symbols-outlined {
    font-size: 18px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content h5 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.notification-content p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.625rem;
    color: #64748b;
}

.no-notifications {
    padding: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.notification-footer {
    padding: 0.75rem;
    border-top: 1px solid #292e38;
}

.view-all-btn {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid #292e38;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.view-all-btn:hover {
    background-color: #21262d;
    color: #ffffff;
}

/* ==========================================================================
   SHARED MODAL
   ========================================================================== */
.shared-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shared-modal-overlay.visible {
    opacity: 1;
}

.shared-modal {
    width: 90%;
    max-width: 28rem;
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.shared-modal-overlay.visible .shared-modal {
    transform: scale(1);
}

.shared-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #292e38;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shared-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

.modal-close-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background-color: #21262d;
    color: #ffffff;
}

.shared-modal-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    background-color: #0f1115;
    border: 1px solid #292e38;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #195de6;
}

.form-group input::placeholder {
    color: #64748b;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

.shared-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #292e38;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-cancel {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid #292e38;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.btn-cancel:hover {
    background-color: #21262d;
    color: #ffffff;
}

.btn-save {
    padding: 0.625rem 1.25rem;
    background-color: #195de6;
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.btn-save:hover {
    background-color: #2563eb;
}

/* ==========================================================================
   SHARED TOAST
   ========================================================================== */
.shared-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.shared-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.shared-toast .material-symbols-outlined {
    font-size: 20px;
}

.shared-toast.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.shared-toast.success .material-symbols-outlined {
    color: #10b981;
}

.shared-toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.shared-toast.error .material-symbols-outlined {
    color: #ef4444;
}

.shared-toast.warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.shared-toast.warning .material-symbols-outlined {
    color: #f59e0b;
}

.shared-toast.info {
    border-color: rgba(59, 130, 246, 0.3);
}

.shared-toast.info .material-symbols-outlined {
    color: #3b82f6;
}

.shared-toast .toast-message {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==========================================================================
   SETTINGS CONTROLS
   ========================================================================== */
.settings-card {
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #292e38;
}

.settings-header .material-symbols-outlined {
    color: #195de6;
    font-size: 24px;
}

.settings-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem 0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(41, 46, 56, 0.5);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    min-width: 0;
}

.setting-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.setting-desc {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    --toggle-width: 2.75rem;
    --toggle-height: 1.5rem;
    --toggle-padding: 0.1875rem;
    --toggle-thumb-size: calc(var(--toggle-height) - (var(--toggle-padding) * 2));

    width: var(--toggle-width);
    height: var(--toggle-height);
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #475569;
    border-radius: 9999px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: var(--toggle-padding);
    top: var(--toggle-padding);
    width: var(--toggle-thumb-size);
    height: var(--toggle-thumb-size);
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.toggle-switch:focus-within {
    outline: 2px solid rgba(37, 99, 235, 0.55);
    outline-offset: 2px;
    border-radius: 9999px;
}

.toggle-switch.on .toggle-slider,
.toggle-switch input:checked+.toggle-slider {
    background-color: #2563eb;
}

.toggle-switch.on .toggle-slider::before,
.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(calc(var(--toggle-width) - var(--toggle-thumb-size) - (var(--toggle-padding) * 2)));
}

/* Light mode toggle styling */
[data-theme="light"] .toggle-switch .toggle-slider,
html.light .toggle-switch .toggle-slider,
body.light .toggle-switch .toggle-slider {
    background-color: #cbd5e1;
    box-shadow: inset 0 0 0 1px #94a3b8;
}

[data-theme="light"] .toggle-switch.on .toggle-slider,
[data-theme="light"] .toggle-switch input:checked+.toggle-slider,
html.light .toggle-switch.on .toggle-slider,
html.light .toggle-switch input:checked+.toggle-slider,
body.light .toggle-switch.on .toggle-slider,
body.light .toggle-switch input:checked+.toggle-slider {
    background-color: #2563eb;
    box-shadow: inset 0 0 0 1px #2563eb;
}

/* Setting Select */
.setting-select {
    padding: 0.5rem 1rem;
    background-color: #0f1115;
    border: 1px solid #292e38;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #195de6;
}

.setting-select option {
    background-color: var(--dropdown-bg, #161b22);
    color: var(--text-primary, #ffffff);
}

/* ==========================================================================
   SCAN HISTORY LIST
   ========================================================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:hover {
    background-color: #1c2128;
    border-color: #3d444d;
}

.history-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-icon.safe {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.history-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.history-icon.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-url {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.history-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-badge.safe {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.history-badge.warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.history-badge.danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.history-score {
    font-weight: 600;
}

.history-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.history-empty .material-symbols-outlined {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.history-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* History Section */
.history-section {
    background-color: #161b22;
    border: 1px solid #292e38;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.history-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-section .section-header h3 {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

/* Text Button (Clear All, etc.) */
.btn-text {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #292e38;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.btn-text:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {

    .profile-dropdown,
    .notification-dropdown {
        position: fixed;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0 !important;
        width: 100%;
        max-height: 70vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
    }

    .profile-dropdown.visible,
    .notification-dropdown.visible {
        transform: translateY(0);
    }

    .shared-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .setting-select,
    .toggle-switch {
        align-self: flex-end;
    }
}

/* ==========================================================================
   TOOLTIP SYSTEM
   Accessible, persistent tooltips for help icons and informational elements
   ========================================================================== */

/* Tooltip trigger element */
.tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

/* Tooltip container */
.tooltip-trigger .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

/* Tooltip arrow */
.tooltip-trigger .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #334155;
}

/* Show tooltip on hover - with delay for accessibility */
.tooltip-trigger:hover .tooltip,
.tooltip-trigger:focus .tooltip,
.tooltip-trigger:focus-within .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Keep tooltip visible while hovering over it */
.tooltip-trigger .tooltip:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Help icon button style */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background-color: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: help;
    transition: all 0.15s ease;
}

.help-icon:hover,
.help-icon:focus {
    background-color: rgba(25, 93, 230, 0.15);
    border-color: rgba(25, 93, 230, 0.3);
    color: #548bf7;
    outline: none;
}

.help-icon .material-symbols-outlined {
    font-size: 14px;
}

/* Tooltip positioned to the right */
.tooltip-trigger.tooltip-right .tooltip {
    left: calc(100% + 10px);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
}

.tooltip-trigger.tooltip-right:hover .tooltip,
.tooltip-trigger.tooltip-right:focus .tooltip {
    transform: translateY(-50%) translateX(0);
}

.tooltip-trigger.tooltip-right .tooltip::after {
    top: 50%;
    left: -6px;
    right: auto;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #334155;
    border-top-color: transparent;
}

/* Tooltip title */
.tooltip-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
    display: block;
}

/* Light mode tooltips */
[data-theme="light"] .tooltip-trigger .tooltip {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .tooltip-trigger .tooltip::after {
    border-top-color: #e2e8f0;
}

[data-theme="light"] .tooltip-trigger.tooltip-right .tooltip::after {
    border-right-color: #e2e8f0;
    border-top-color: transparent;
}

[data-theme="light"] .tooltip-title {
    color: #0f172a;
}

[data-theme="light"] .help-icon {
    background-color: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.2);
    color: #64748b;
}

[data-theme="light"] .help-icon:hover,
[data-theme="light"] .help-icon:focus {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563eb;
}
