/**
 * IKIGAI COMBAT - Flash Messages
 * Sistema de notificações com acessibilidade
 * Refatorado - Fev 2025
 */

.flash-messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 500px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.flash-messages-container .flash-message {
    margin-bottom: 15px;
    pointer-events: all;
}

@media (max-width: 768px) {
    .flash-messages-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
}

.flash-message {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    min-height: 70px;
    overflow: hidden;
    animation: flashSlideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: var(--transition);
}

.flash-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.1);
}

.flash-message.flash-dismissing {
    animation: flashSlideOutRight 0.4s cubic-bezier(0.55, 0.09, 0.68, 0.53) forwards;
    opacity: 0;
}

.flash-message.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #047857;
    color: #ffffff;
}

.flash-message.alert-success .flash-icon {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.flash-message.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #b91c1c;
    color: #ffffff;
}

.flash-message.alert-danger .flash-icon {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.flash-message.alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #b45309;
    color: #ffffff;
}

.flash-message.alert-warning .flash-icon {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.flash-message.alert-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #ffffff;
}

.flash-message.alert-info .flash-icon {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.flash-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    margin-right: 15px;
}

.flash-content {
    flex: 1;
    min-width: 0;
}

.flash-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: inherit;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.flash-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    color: inherit;
    opacity: 0.95;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.flash-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    padding: 8px;
    margin: -4px -8px -4px 10px;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.flash-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.flash-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.flash-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
    transition: none;
}

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

@keyframes flashSlideOutRight {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(120%) scale(0.95); }
}

.flash-message.flash-pulse {
    animation: flashPulse 2s infinite;
}

@keyframes flashPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08); }
    50% { box-shadow: 0 4px 25px rgba(0, 0, 0, 0.25), 0 2px 5px rgba(0, 0, 0, 0.15); }
}

.flash-message:focus-within {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .flash-message { animation: none; transition: none; }
    .flash-message.flash-dismissing { animation: none; opacity: 0; }
    .flash-progress { transition: none; animation: none; }
}

@media (prefers-contrast: high) {
    .flash-message { border-width: 3px; font-weight: 600; }
    .flash-title { font-weight: 800; }
}

@media (max-width: 992px) {
    .flash-messages-container { max-width: 450px; }
    .flash-message { padding: 14px 18px; }
    .flash-icon { width: 36px; height: 36px; font-size: 18px; margin-right: 12px; }
    .flash-title { font-size: 15px; }
    .flash-text { font-size: 13px; }
}

@media (max-width: 768px) {
    .flash-message { padding: 12px 16px; min-height: 60px; }
    .flash-icon { width: 32px; height: 32px; font-size: 16px; margin-right: 10px; }
    .flash-title { font-size: 14px; }
    .flash-text { font-size: 13px; }
    .flash-close { font-size: 18px; padding: 6px; }
}

@media (max-width: 480px) {
    .flash-messages-container { top: 60px; }
    .flash-message { border-radius: 8px; }
}

@media (prefers-color-scheme: dark) {
    .flash-message { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3); }
    .flash-message:hover { box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 2px 5px rgba(0, 0, 0, 0.4); }
}

.flash-message * {
    color: inherit !important;
    opacity: inherit !important;
}

.flash-message .flash-content {
    overflow-wrap: anywhere;
}
