/**
 * AquaSentinel Intelligence OS - Global Alert System
 * ULTRA-ADVANCED PREMIUM UI & MOTION DESIGN
 * Cinematic Mission-Critical Alert Layer
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --alert-high-glow: rgba(255, 51, 102, 0.5);
    --alert-med-glow: rgba(255, 153, 0, 0.5);
    --alert-info-glow: rgba(0, 243, 255, 0.5);
    --alert-bg: rgba(10, 15, 28, 0.92);
    --alert-border: rgba(255, 255, 255, 0.12);
}

.global-alert-container {
    position: fixed;
    top: 2.5rem;
    right: 2.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    pointer-events: none;
    perspective: 1000px;
}

.premium-alert-card {
    pointer-events: auto;
    width: 420px;
    background: var(--alert-bg);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-radius: 24px;
    border: 1px solid var(--alert-border);
    padding: 1.8rem;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.3),
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow: hidden;
    position: relative;
    transform-origin: top right;
    font-family: 'Manrope', sans-serif;
    animation: cinematic-entry 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.premium-alert-card.exit {
    animation: cinematic-exit 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cinematic-entry {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.85) rotateX(-15deg);
        filter: blur(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0);
        filter: blur(0);
    }
}

@keyframes cinematic-exit {
    0% { opacity: 1; transform: scale(1); filter: blur(0); }
    100% { opacity: 0; transform: scale(0.9) translateY(-20px); filter: blur(10px); }
}

/* Severity Signatures */
.premium-alert-card.high { border-color: rgba(255, 51, 102, 0.4); box-shadow: 0 0 40px var(--alert-high-glow), 0 25px 50px -12px rgba(0, 0, 0, 0.7); }
.premium-alert-card.medium { border-color: rgba(255, 153, 0, 0.4); box-shadow: 0 0 40px var(--alert-med-glow), 0 25px 50px -12px rgba(0, 0, 0, 0.7); }
.premium-alert-card.info { border-color: rgba(0, 243, 255, 0.4); box-shadow: 0 0 40px var(--alert-info-glow), 0 25px 50px -12px rgba(0, 0, 0, 0.7); }

/* Header & Holographic Icon */
.alert-header {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.alert-icon-node {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: icon-float 3s infinite ease-in-out;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.alert-icon-node i {
    font-size: 1.5rem;
    z-index: 2;
    animation: hologram-flicker 4s infinite;
}

@keyframes hologram-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; filter: drop-shadow(0 0 10px currentColor); }
    20%, 22%, 24%, 55% { opacity: 0.5; filter: none; }
}

.high .alert-icon-node i { color: #ff3366; }
.medium .alert-icon-node i { color: #ff9900; }
.info .alert-icon-node i { color: #00f3ff; }

/* Radar / Pulse Ripple */
.ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 2px solid currentColor;
    opacity: 0;
    animation: radar-ripple 2s infinite;
}

@keyframes radar-ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Typography Hierarchy */
.alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.3;
    letter-spacing: 0.2px;
    color: #fff;
    margin: 0;
}

.alert-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    font-weight: 500;
    margin: 0;
}

/* Premium Chips */
.alert-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.alert-chip {
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.high .alert-chip { border-color: rgba(255, 51, 102, 0.2); }

/* Footer / CTA */
.alert-footer {
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-footer-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.alert-footer-cta {
    font-size: 0.75rem;
    color: var(--accent-color, #00f3ff);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Shimmer Sweep Animation */
.shimmer-sweep {
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transform: skewX(-25deg);
    animation: cinematic-shimmer 4s 1s infinite;
}

@keyframes cinematic-shimmer {
    0% { left: -150%; }
    20%, 100% { left: 250%; }
}

/* Progress Timer Edge */
.alert-timer-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, #00f3ff, #0077ff);
    transform-origin: left;
    animation: cinematic-timer 5s linear forwards;
}

.high .alert-timer-edge { background: linear-gradient(to right, #ff3366, #ff0044); }

@keyframes cinematic-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Staggered Content Reveal */
.alert-icon-node { animation: cinematic-pop 0.5s 0.1s both; }
.alert-title { animation: fade-in-reveal 0.6s 0.2s both; }
.alert-message { animation: fade-in-reveal 0.6s 0.3s both; }
.alert-chips { animation: fade-in-reveal 0.6s 0.4s both; }
.alert-footer { animation: fade-in-reveal 0.6s 0.5s both; }

@keyframes cinematic-pop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fade-in-reveal {
    from { opacity: 0; transform: translateY(15px) skewY(2deg); }
    to { opacity: 1; transform: translateY(0) skewY(0); }
}
