/**
 * AILMS Reload Hint Tooltip
 * Apple macOS-style keyboard shortcut hint
 * Version: 1.0.0
 */

/* Container - Floating pill at bottom center */
.ailms-reload-hint {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    max-width: 520px;
    width: auto;
    background: rgba(30, 30, 30, 0.78);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        0 2px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Show state */
.ailms-reload-hint.ailms-hint-visible {
    animation: ailms-hint-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

/* Dismiss state */
.ailms-reload-hint.ailms-hint-dismiss {
    animation: ailms-hint-fade-out 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* Icon */
.ailms-hint-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.2) 0%, rgba(255, 175, 0, 0.15) 100%);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
}

/* Text content */
.ailms-hint-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.ailms-hint-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    margin-top: 2px;
}

/* Keyboard keycaps - macOS style */
.ailms-keycap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    margin: 0 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom-width: 2px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    line-height: 1;
    letter-spacing: 0;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    white-space: nowrap;
}

.ailms-keycap-symbol {
    font-size: 14px;
    font-weight: 400;
}

.ailms-keycap + .ailms-keycap {
    margin-left: 3px;
}

/* Close button */
.ailms-hint-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    margin-left: 4px;
    transition: all 0.15s ease;
    line-height: 1;
}

.ailms-hint-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.ailms-hint-close:active {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(0.92);
}

/* Progress bar for auto-dismiss */
.ailms-hint-progress {
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
    overflow: hidden;
}

.ailms-hint-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1px;
    width: 100%;
    animation: ailms-hint-countdown 8s linear forwards;
}

/* Animations */
@keyframes ailms-hint-slide-up {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes ailms-hint-fade-out {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
}

@keyframes ailms-hint-countdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* Responsive */
@media (max-width: 580px) {
    .ailms-reload-hint {
        left: 12px;
        right: 12px;
        bottom: 16px;
        max-width: none;
        width: auto;
        transform: translateX(0) translateY(100%);
        padding: 12px 16px;
    }

    .ailms-reload-hint.ailms-hint-visible {
        animation-name: ailms-hint-slide-up-mobile;
    }

    .ailms-reload-hint.ailms-hint-dismiss {
        animation-name: ailms-hint-fade-out-mobile;
    }

    .ailms-hint-progress {
        left: 12px;
        right: 12px;
    }
}

@keyframes ailms-hint-slide-up-mobile {
    from {
        transform: translateX(0) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes ailms-hint-fade-out-mobile {
    from {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(0) translateY(20px);
        opacity: 0;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ailms-reload-hint.ailms-hint-visible,
    .ailms-reload-hint.ailms-hint-dismiss {
        animation: none;
    }

    .ailms-reload-hint.ailms-hint-visible {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    .ailms-reload-hint.ailms-hint-dismiss {
        opacity: 0;
    }

    .ailms-hint-progress-bar {
        animation: none;
    }
}

@media (max-width: 580px) and (prefers-reduced-motion: reduce) {
    .ailms-reload-hint.ailms-hint-visible {
        transform: translateX(0) translateY(0);
    }
}
