/**
 * Session Manager - Estilos de Notificação
 * 
 * Estilos otimizados para desktop e mobile
 * Garante visibilidade em todos os dispositivos
 */

/* ==================== NOTIFICAÇÃO DE SESSÃO EXPIRANDO ==================== */
.session-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999; /* Acima de tudo */
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    pointer-events: none;
}

.session-notification.show {
    transform: translateY(0);
    pointer-events: auto;
}

.session-notification-content {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.session-notification-icon {
    font-size: 32px;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.session-notification-text {
    flex: 1;
    min-width: 0;
}

.session-notification-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.session-notification-message {
    font-size: 14px;
    opacity: 0.95;
    margin: 0;
}

.session-notification-actions {
    display: flex;
    gap: 10px;
}

.session-btn-continue,
.session-btn-logout {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.session-btn-continue {
    background: white;
    color: #ff6b35;
}

.session-btn-continue:hover {
    background: #f5f5f5;
    transform: scale(1.02);
}

.session-btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.session-btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.session-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.session-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== NOTIFICAÇÃO DE RETORNO ==================== */
.session-return-notification {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 999998;
    opacity: 0;
    transition: all 0.3s ease-out;
    pointer-events: none;
}

.session-return-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.session-return-content {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(33, 150, 243, 0.4);
    font-size: 15px;
    white-space: nowrap;
}

.session-return-content i {
    font-size: 24px;
    animation: wave 0.8s ease-in-out;
}

@keyframes wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

/* ==================== NOTIFICAÇÃO DE LOGOUT ==================== */
.session-logout-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.session-logout-notification.show {
    opacity: 1;
}

.session-logout-content {
    background: white;
    padding: 32px 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.session-logout-content i {
    font-size: 48px;
    color: #ff6b35;
}

.session-logout-content strong {
    display: block;
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

.session-logout-content p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* ==================== RESPONSIVO - TABLETS ==================== */
@media (max-width: 900px) {
    .session-notification-content {
        padding: 14px 16px;
        gap: 12px;
    }

    .session-notification-icon {
        font-size: 28px;
    }

    .session-notification-title {
        font-size: 15px;
    }

    .session-notification-message {
        font-size: 13px;
    }

    .session-btn-continue,
    .session-btn-logout {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==================== RESPONSIVO - MOBILE ==================== */
@media (max-width: 600px) {
    .session-notification-content {
        flex-wrap: wrap;
        padding: 16px;
        padding-top: 32px; /* Espaço para o X */
        gap: 12px;
    }

    .session-notification-icon {
        font-size: 24px;
        flex-shrink: 0;
    }

    .session-notification-text {
        flex: 1;
        min-width: calc(100% - 48px);
    }

    .session-notification-title {
        font-size: 15px;
    }

    .session-notification-message {
        font-size: 13px;
        line-height: 1.4;
    }

    .session-notification-actions {
        width: 100%;
        justify-content: stretch;
    }

    .session-btn-continue,
    .session-btn-logout {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }

    .session-notification-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Notificação de retorno - mobile */
    .session-return-notification {
        bottom: 100px;
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
    }

    .session-return-notification.show {
        transform: translateX(0) translateY(0);
    }

    .session-return-content {
        padding: 14px 18px;
        font-size: 14px;
        white-space: normal;
        border-radius: 10px;
    }

    .session-return-content i {
        font-size: 20px;
    }

    /* Notificação de logout - mobile */
    .session-logout-content {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
        margin: 20px;
    }

    .session-logout-content i {
        font-size: 56px;
    }

    .session-logout-content strong {
        font-size: 18px;
    }

    .session-logout-content p {
        font-size: 14px;
    }
}

/* ==================== TOAST MELHORADO PARA MOBILE ==================== */
/* Sobrescreve estilos do toast para garantir visibilidade */
@media (max-width: 600px) {
    .toast,
    #toast {
        position: fixed !important;
        bottom: 100px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        transform: translateX(0) translateY(20px) !important;
        z-index: 99999 !important;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease !important;
        background: #333 !important;
        color: white !important;
        padding: 14px 18px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .toast.show,
    #toast.show {
        transform: translateX(0) translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .toast i,
    #toast i {
        font-size: 18px !important;
    }

    .toast.success,
    #toast.success {
        background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    }

    .toast.error,
    #toast.error {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    }

    .toast.warning,
    #toast.warning {
        background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
        color: #333 !important;
    }
}

/* ==================== SAFE AREA PARA iOS ==================== */
@supports (padding: max(0px)) {
    .session-notification-content {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    @media (max-width: 600px) {
        .session-return-notification {
            bottom: max(100px, calc(80px + env(safe-area-inset-bottom)));
        }

        .toast,
        #toast {
            bottom: max(100px, calc(80px + env(safe-area-inset-bottom))) !important;
        }
    }
}

/* ==================== DARK MODE (se aplicável) ==================== */
@media (prefers-color-scheme: dark) {
    .session-logout-content {
        background: #2a2a2a;
    }

    .session-logout-content strong {
        color: #fff;
    }

    .session-logout-content p {
        color: #bbb;
    }
}
