/* /css/quick_tools.css */
/* Core Floating Action Button (FAB) Speed Dial Styles */

/* --- FAB Container & Widget Positioning --- */
.global-fab-container {
    position: fixed;
    bottom: 25px;
    right: 30px;
    width: 48px;
    height: 48px;
    z-index: 1050;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.global-fab-container.fab-disabled {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.global-fab-container.is-scrolling:not(:hover):not(.active) {
    opacity: 0.25 !important;
}

.global-fab-container.is-dragging {
    transition: none !important;
    user-select: none !important;
}

.global-fab-container.is-dragging #global-fab-main-btn {
    cursor: grabbing !important;
    transform: scale(1.14);
    box-shadow: 0 0 24px var(--button-glow, rgba(108, 99, 255, 0.6)) !important;
    transition: none !important;
}

/* --- Main Trigger Button --- */
#global-fab-main-btn {
    width: 48px;
    height: 48px;
    background-color: var(--apple-accent-color, #6c63ff);
    border: none;
    box-shadow: 0 0 12px var(--button-glow, rgba(108, 99, 255, 0.35)) !important;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: grab;
    pointer-events: auto;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: #ffffff !important;
    touch-action: none;
    user-select: none;
}

#global-fab-main-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 16px var(--button-glow, rgba(108, 99, 255, 0.5)) !important;
}

#global-fab-main-btn:active {
    transform: scale(0.92);
}

.global-fab-container.active #global-fab-main-btn {
    background-color: var(--bs-secondary, #6c757d) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}

.global-fab-container.active #global-fab-main-icon {
    transform: rotate(135deg);
}

#global-fab-main-icon {
    font-size: 1.2rem;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    pointer-events: none;
}

/* --- Floating Glassmorphic Quick Tools Dock Micro-Panel --- */
.global-fab-dock {
    position: absolute;
    bottom: 58px;
    right: 0;
    width: 300px;
    background: rgba(var(--bs-body-bg-rgb, 30, 30, 42), 0.88);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.14));
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.06);
    padding: 10px;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.94);
    transform-origin: bottom right;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0.22s;
}

.global-fab-container.active .global-fab-dock {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Dynamic Dock Orientations based on viewport location */
.global-fab-dock.dock-down {
    bottom: auto;
    top: 58px;
    transform: translateY(-14px) scale(0.94);
    transform-origin: top right;
}

.global-fab-container.active .global-fab-dock.dock-down {
    transform: translateY(0) scale(1);
}

.global-fab-dock.dock-right {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.global-fab-dock.dock-down.dock-right {
    transform-origin: top left;
}

/* Dock Header Filter Bar */
.global-fab-dock-header {
    padding: 2px 2px 6px 2px;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    margin-bottom: 6px;
}

.global-fab-dock-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: text;
}

.global-fab-dock-filter-wrap:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--apple-accent-color, #6c63ff);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb, 108, 99, 255), 0.25);
}

[data-bs-theme="light"] .global-fab-dock-filter-wrap {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .global-fab-dock-filter-wrap:focus-within {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--apple-accent-color, #6c63ff);
}

.global-fab-dock-filter-icon {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #94a3b8);
    flex-shrink: 0;
}

.global-fab-dock-filter-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--bs-body-color, #ffffff);
    padding: 0;
    min-width: 0;
    box-shadow: none !important;
}

.global-fab-dock-filter-input::placeholder {
    color: var(--bs-secondary-color, #94a3b8);
    opacity: 0.8;
}

/* Dock Empty State */
.global-fab-dock-empty {
    padding: 10px 8px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #94a3b8);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--bs-border-color-translucent, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    margin-top: 3px;
}

/* Dock Body & Items */
.global-fab-dock-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.global-fab-dock-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 9px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.18s ease, transform 0.18s ease;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.global-fab-dock-item:hover,
.global-fab-dock-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-3px);
}

.global-fab-dock-item:active {
    transform: scale(0.98);
}

[data-bs-theme="light"] .global-fab-dock {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .global-fab-dock-item:hover,
[data-bs-theme="light"] .global-fab-dock-item:focus-visible {
    background: rgba(0, 0, 0, 0.05);
}

.global-fab-dock-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #ffffff !important;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
    z-index: 1;
}

.global-fab-dock-icon i {
    position: relative;
    z-index: 2;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.28s ease;
}

/* Glowing Aura Halo Ring */
.global-fab-dock-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    background: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    transform: scale(0.9);
}

/* Aura Pulse Keyframes */
@keyframes fabAuraPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.85;
    }

    50% {
        transform: scale(1.35);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.global-fab-dock-item:hover .global-fab-dock-icon,
.global-fab-dock-item:focus-visible .global-fab-dock-icon {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 0 18px var(--dock-icon-glow, rgba(255, 255, 255, 0.4)), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.global-fab-dock-item:hover .global-fab-dock-icon::before,
.global-fab-dock-item:focus-visible .global-fab-dock-icon::before {
    opacity: 0.85;
    animation: fabAuraPulse 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.global-fab-dock-item:hover .global-fab-dock-icon i,
.global-fab-dock-item:focus-visible .global-fab-dock-icon i {
    transform: scale(1.12);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

.global-fab-dock-text {
    flex: 1;
    min-width: 0;
}

.global-fab-dock-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--bs-body-color, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-fab-dock-item-desc {
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #94a3b8);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-fab-dock-shortcut kbd {
    font-size: 0.68rem;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: var(--bs-secondary-color, #cbd5e1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    font-weight: 600;
}

[data-bs-theme="light"] .global-fab-dock-shortcut kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--bs-body-color, #495057);
}

/* Dock Footer */
.global-fab-dock-footer {
    border-top: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    margin-top: 6px;
    padding-top: 5px;
    padding-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.global-fab-dock-reset-btn {
    font-size: 0.74rem;
    color: var(--bs-secondary-color, #94a3b8) !important;
    padding: 4px 8px;
    border-radius: 8px;
    border: none;
    background: transparent;
    transition: color 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.global-fab-dock-reset-btn:hover {
    color: var(--apple-accent-color, #6c63ff) !important;
    background: rgba(var(--bs-primary-rgb, 108, 99, 255), 0.12);
}

.global-fab-dock-hide-btn {
    font-size: 0.74rem;
    color: var(--bs-secondary-color, #94a3b8) !important;
    padding: 4px 8px;
    border-radius: 8px;
    border: none;
    background: transparent;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.global-fab-dock-hide-btn:hover {
    color: var(--bs-danger, #ef4444) !important;
    background: rgba(239, 68, 68, 0.12);
}

/* Tool Gradient Theme Definitions */
.btn-search-tool {
    --dock-icon-glow: rgba(108, 99, 255, 0.65);
    background: linear-gradient(135deg, var(--apple-accent-color, #6c63ff), #8b5cf6) !important;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.45) !important;
}

.btn-notes-tool {
    --dock-icon-glow: rgba(245, 158, 11, 0.65);
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45) !important;
}

.btn-cal-tool {
    --dock-icon-glow: rgba(59, 130, 246, 0.65);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.45) !important;
}

.btn-timer-tool {
    --dock-icon-glow: rgba(239, 68, 68, 0.65);
    background: linear-gradient(135deg, #ef4444, #ec4899) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45) !important;
}

.btn-calc-tool {
    --dock-icon-glow: rgba(16, 185, 129, 0.65);
    background: linear-gradient(135deg, #10b981, #06b6d4) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.45) !important;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .global-fab-container {
        bottom: 18px;
        right: 18px;
    }

    .global-fab-dock {
        width: calc(100vw - 36px);
        max-width: 320px;
        bottom: 58px;
    }
}

/* --- Common Base Glassmorphism Modal Styles --- */
#quickToolsHubModal .modal-content,
#quickNotesModal .modal-content,
#companyCalendarModal .modal-content,
#calendarEventModal .modal-content,
#calendarFeedsModal .modal-content,
#calendarEventDetailsModal .modal-content {
    background: rgba(var(--bs-body-bg-rgb), 0.88) !important;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 20px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
}

/* Quick Tools Hub Modal Styles */
.quick-tools-hub-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--apple-accent-color, #6c63ff);
    box-shadow: 0 0 12px var(--button-glow, rgba(108, 99, 255, 0.4));
}

.quick-tools-hub-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.12));
    border-radius: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.quick-tools-hub-search-wrap:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--apple-accent-color, #6c63ff);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb, 108, 99, 255), 0.25);
}

[data-bs-theme="light"] .quick-tools-hub-search-wrap {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.quick-tools-hub-search-input {
    border: none !important;
    background: transparent !important;
    color: var(--bs-body-color, #ffffff) !important;
    padding: 0 !important;
    font-size: 0.92rem;
    box-shadow: none !important;
}

.quick-tools-hub-search-input::placeholder {
    color: var(--bs-secondary-color, #94a3b8);
    opacity: 0.8;
}

.quick-tools-hub-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    outline: none;
}

.quick-tools-hub-card:hover,
.quick-tools-hub-card:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--apple-accent-color, #6c63ff);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--apple-accent-color, #6c63ff);
}

[data-bs-theme="light"] .quick-tools-hub-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .quick-tools-hub-card:hover,
[data-bs-theme="light"] .quick-tools-hub-card:focus-visible {
    background: rgba(0, 0, 0, 0.06);
}

.quick-tools-hub-card-title {
    font-size: 0.95rem;
    color: var(--bs-heading-color, var(--bs-body-color, #ffffff));
}

.quick-tools-hub-card-desc {
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #94a3b8);
    line-height: 1.35;
}

.quick-tools-hub-shortcut kbd {
    font-size: 0.7rem;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: var(--bs-secondary-color, #cbd5e1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    font-weight: 600;
}

[data-bs-theme="light"] .quick-tools-hub-shortcut kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--bs-body-color, #495057);
}

/* Icon Style 4 with Glowing Aura Pulse in Hub Modal */
.quick-tools-hub-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.quick-tools-hub-card-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 18px;
    background: var(--dock-icon-glow, rgba(255, 255, 255, 0.5));
    filter: blur(6px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    transform: scale(0.9);
}

.quick-tools-hub-card:hover .quick-tools-hub-card-icon,
.quick-tools-hub-card:focus-visible .quick-tools-hub-card-icon {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 0 20px var(--dock-icon-glow, rgba(255, 255, 255, 0.4)), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.quick-tools-hub-card:hover .quick-tools-hub-card-icon::before,
.quick-tools-hub-card:focus-visible .quick-tools-hub-card-icon::before {
    opacity: 0.85;
    animation: fabAuraPulse 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.quick-tools-hub-card:hover .quick-tools-hub-card-icon i,
.quick-tools-hub-card:focus-visible .quick-tools-hub-card-icon i {
    transform: scale(1.12);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

/* Popover switch item in sidebar */
.user-popover-menu .popover-switch-item {
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--sidebar-text-color);
    font-size: 0.9rem;
    border-top: 1px solid var(--bs-border-color-translucent);
    user-select: none;
}

.user-popover-menu .popover-switch-item .form-check-input {
    cursor: pointer;
}

.user-popover-menu .popover-switch-item .form-check-input:checked {
    background-color: var(--apple-accent-color);
    border-color: var(--apple-accent-color);
}