/**
 * Onyx Mail - Security Alert System CSS
 * Styles for warrant canary alerts, notifications, and status indicators
 * Maintains cyberpunk aesthetic with urgent visual feedback
 */

/* ===== CRITICAL ALERT BANNER ===== */
.critical-alert-banner {
    position: relative;
    background: linear-gradient(135deg, #1a0000 0%, #330000 50%, #1a0000 100%);
    border: 2px solid #ff0000;
    border-radius: 8px;
    margin: 2rem 0;
    padding: 2rem;
    overflow: hidden;
    animation: criticalPulse 2s infinite;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 0, 0, 0.1);
}

.critical-alert-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.1), transparent);
    animation: alertSweep 3s infinite;
}

.alert-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.alert-beacon {
    width: 24px;
    height: 24px;
    background: #ff0000;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
    animation: pulse-red 1s infinite;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.alert-text h3 {
    color: #ff0000;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: glitchText 3s infinite;
}

.alert-text p {
    color: #f3f4f6;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-text .alert-motto {
    color: #8b5cf6;
    font-style: italic;
    font-family: 'Courier New', monospace;
    margin-bottom: 0;
    text-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
}

/* ===== STATUS INDICATORS ===== */
.canary-status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.pulse-green {
    background: #00ff00;
    animation: pulse-green 2s infinite;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
}

.pulse-red {
    background: #ff0000;
    animation: pulse-red 1s infinite;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.red-beacon {
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.5rem;
    animation: pulse-red 1s infinite;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
}

/* ===== PULSE ANIMATIONS ===== */
@keyframes pulse-green {
    0% { 
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
        background: #00ff00;
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
        background: #00cc00;
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
        background: #00ff00;
    }
}

@keyframes pulse-red {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.8);
        background: #ff0000;
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
        background: #cc0000;
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
        background: #ff0000;
    }
}

@keyframes criticalPulse {
    0% { 
        border-color: #ff0000;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    }
    50% { 
        border-color: #ff4444;
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    }
    100% { 
        border-color: #ff0000;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    }
}

@keyframes alertSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== TEXT EFFECTS ===== */
.glitch-text {
    position: relative;
    animation: glitchText 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitchBefore 3s infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch-text::after {
    animation: glitchAfter 3s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitchText {
    0%, 90%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitchBefore {
    0%, 90%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(-2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

@keyframes glitchAfter {
    0%, 90%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

.pulse-red-text {
    animation: pulseRedText 1s infinite;
}

@keyframes pulseRedText {
    0% { color: #ff0000; text-shadow: 0 0 5px rgba(255, 0, 0, 0.5); }
    50% { color: #ff4444; text-shadow: 0 0 10px rgba(255, 0, 0, 0.8); }
    100% { color: #ff0000; text-shadow: 0 0 5px rgba(255, 0, 0, 0.5); }
}

/* ===== COUNTDOWN TIMER ===== */
.canary-countdown {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B5CF6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.canary-countdown:hover {
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
    transform: scale(1.05);
}

/* ===== HASH CHAIN DISPLAY ===== */
.hash-chain-display {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.hash-truncated {
    cursor: pointer;
    color: #8B5CF6;
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
}

.hash-truncated:hover {
    color: #a78bfa;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

.hash-expanded {
    word-break: break-all;
    line-height: 1.4;
    padding: 0.5rem 0;
}

.hash-glow {
    animation: hashGlow 0.3s ease;
}

@keyframes hashGlow {
    0% { text-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
    50% { text-shadow: 0 0 15px rgba(139, 92, 246, 0.8); }
    100% { text-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
}

.hash-expand-hint,
.hash-collapse-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.copy-hash-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #8B5CF6;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-hash-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8B5CF6;
    color: white;
}

.hash-error {
    color: #ff0000;
    font-weight: 600;
    margin-top: 0.5rem;
    animation: pulseRedText 1s infinite;
}

/* ===== SIGNATURE STATUS ===== */
.signature-status {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid;
}

.notification--success {
    background: #22c55e;
    color: white;
    border-color: #16a34a;
}

.notification--error {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

@keyframes slideInNotification {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOutNotification {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

/* ===== WARRANT CANARY STATUS ===== */
.warrant-canary-status {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* ===== SECURITY STATUS SECTION ===== */
.security-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .critical-alert-banner {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .alert-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .alert-beacon {
        margin-top: 0;
        align-self: flex-start;
    }
    
    .alert-text h3 {
        font-size: 1rem;
    }
    
    .alert-text p {
        font-size: 0.85rem;
    }
    
    .canary-countdown {
        font-size: 0.9rem;
    }
    
    .hash-chain-display {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .critical-alert-banner {
        padding: 0.75rem;
    }
    
    .alert-text h3 {
        font-size: 0.9rem;
    }
    
    .alert-text p {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .canary-countdown {
        font-size: 0.8rem;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .critical-alert-banner {
        border-width: 3px;
        background: #000000;
    }
    
    .pulse-red {
        background: #ff0000;
        border: 2px solid #ffffff;
    }
    
    .pulse-green {
        background: #00ff00;
        border: 2px solid #ffffff;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .critical-alert-banner,
    .pulse-red,
    .pulse-green,
    .glitch-text,
    .canary-countdown,
    .hash-glow {
        animation: none;
    }
    
    .critical-alert-banner {
        border-color: #ff0000;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    }
}

/* ===== ACCESSIBILITY ===== */
.canary-status-indicator,
.red-beacon,
.alert-beacon {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.canary-status-indicator:focus,
.red-beacon:focus,
.alert-beacon:focus {
    outline-color: #8B5CF6;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}