/* UIAnimator Styles - Minimal CSS for animation components */

/* Tooltip Styles */
.ui-tooltip {
    position: absolute;
    z-index: 10000;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 150ms ease, transform 150ms ease;
    max-width: 240px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ui-tooltip[aria-hidden="false"] {
    opacity: 1;
    transform: translateY(0);
}

.ui-tooltip[data-placement="below"] {
    transform: translateY(-4px);
}

.ui-tooltip[data-placement="below"][aria-hidden="false"] {
    transform: translateY(0);
}

.ui-tooltip[data-placement="left"] {
    transform: translateX(4px);
}

.ui-tooltip[data-placement="left"][aria-hidden="false"] {
    transform: translateX(0);
}

.ui-tooltip[data-placement="right"] {
    transform: translateX(-4px);
}

.ui-tooltip[data-placement="right"][aria-hidden="false"] {
    transform: translateX(0);
}

/* History tooltip specific styling */
.ui-tooltip.history-tooltip {
    background-color: rgba(25, 25, 25, 0.95);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    text-align: left;
    white-space: pre-wrap; /* Allows newlines from content to break */
    padding: 10px 15px;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ui-tooltip.history-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(25, 25, 25, 0.95);
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.ui-tooltip.history-tooltip[data-placement="above"]::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(30, 41, 59, 0.95);
}

.ui-tooltip.history-tooltip[data-placement="below"]::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(30, 41, 59, 0.95);
}

/* Toast/Status Styles */
.ui-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 320px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: auto;
}

.ui-toast:not(.ui-toast--hidden) {
    opacity: 1;
    transform: translateY(0);
}

.ui-toast--info {
    background: rgba(59, 130, 246, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(59, 130, 246, 0.3);
}

.ui-toast--success {
    background: rgba(34, 197, 94, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(34, 197, 94, 0.3);
}

.ui-toast--warning {
    background: rgba(245, 158, 11, 0.9);
    color: rgba(15, 23, 42, 0.95);
    border-color: rgba(245, 158, 11, 0.3);
}

.ui-toast--error {
    background: rgba(239, 68, 68, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(239, 68, 68, 0.3);
}

.ui-toast--hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Legacy cache-status compatibility */
#cache-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    max-width: 320px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: auto;
}

#cache-status:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

#cache-status.fade-in {
    opacity: 1;
    transform: translateY(0);
}

#cache-status.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

/* Animation utilities */
.ui-fade-in {
    animation: ui-fade-in 200ms ease forwards;
}

.ui-fade-out {
    animation: ui-fade-out 200ms ease forwards;
}

.ui-slide-in-up {
    animation: ui-slide-in-up 200ms ease forwards;
}

.ui-slide-out-up {
    animation: ui-slide-out-up 200ms ease forwards;
}

.ui-slide-in-down {
    animation: ui-slide-in-down 200ms ease forwards;
}

.ui-slide-out-down {
    animation: ui-slide-out-down 200ms ease forwards;
}

/* Shake Animation */
.ui-shaking {
    animation-duration: 600ms;
    animation-timing-function: ease-in-out;
    animation-iteration-count: 1;
}

/* Pulse Animation */
.ui-pulsing {
    transform-origin: center;
}

/* Skeleton Loading */
.ui-skeleton {
    width: 100%;
    opacity: 0;
}

.ui-skeleton__line {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 4px;
    width: 100%;
}

.ui-skeleton--animated .ui-skeleton__line {
    background-size: 200% 100%;
    animation: ui-skeleton-shimmer 1.5s ease-in-out infinite;
}

/* Modal Styles */
.ui-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
}

.ui-modal {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    max-width: 600px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 200ms ease;
}

.ui-modal-overlay:not(.ui-toast--hidden) .ui-modal {
    transform: scale(1) translateY(0);
}

.ui-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    z-index: 1;
    transition: background 150ms ease, color 150ms ease;
}

.ui-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 1);
}

.ui-modal__content {
    padding: 24px;
    color: rgba(255, 255, 255, 0.9);
    overflow-y: auto;
    max-height: calc(90vh - 48px);
}

@keyframes ui-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ui-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes ui-slide-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ui-slide-out-up {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes ui-slide-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ui-slide-out-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes ui-skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ui-toast,
    #cache-status {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.85rem;
    }
    
    .ui-tooltip {
        font-size: 0.8rem;
        max-width: 200px;
        padding: 6px 10px;
    }
    
    .ui-modal {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .ui-modal__content {
        padding: 20px;
        max-height: calc(100vh - 60px);
    }
}