/* Base styles */
@media (prefers-color-scheme: dark) {
    :root {
        --alert-shadow: rgba(0, 0, 0, 0.25);
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --alert-shadow: rgba(0, 0, 0, 0.16);
    }
}

/* Alert container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    z-index: 9999; /* Increased z-index to ensure alerts display above other elements */
}

.alert-container .notification {
    margin-bottom: 1rem;
    box-shadow: 0 3px 6px var(--alert-shadow), 0 3px 6px var(--alert-shadow);
    opacity: 1;
    transition: opacity 0.5s ease-out;
    pointer-events: auto !important; /* Ensure clicks are registered */
    display: block !important; /* Force display */
}

.alert-container .notification.fade-out {
    opacity: 0;
}

/* HTMX Loading States */
.htmx-indicator{
    opacity:0;
    transition: opacity 500ms ease-in;
}
.htmx-request .htmx-indicator{
    opacity:1;
}
.htmx-request.htmx-indicator{
    opacity:1;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease 0.3s, visibility 0.2s ease 0.3s;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 250px;
    max-width: 350px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    box-shadow: 0 3px 6px var(--alert-shadow), 0 3px 6px var(--alert-shadow);
}

.toast-notification.toast-visible {
    transform: translateX(0);
}

.toast-notification.toast-hidden {
    opacity: 0;
    transform: translateX(120%);
}
