/* assets/css/notifications.css */

:root {
    --notif-bg-dark: #0f172a; 
    --notif-bg-card: #1e293b;
    --notif-accent: #3b82f6;
    --notif-accent-hover: #2563eb;
    --notif-gold: #f59e0b;
    --notif-magic-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    --notif-text: #f3f4f6;
    --notif-text-muted: #94a3b8;
    --notif-border: #334155;
    --notif-danger: #ef4444;
}

.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; transition: background 0.3s; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #64748b; }

.magic-btn-small {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    animation: gradientBG 3s ease infinite;
    border: none; padding: 6px 18px; border-radius: 99px; color: white;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    cursor: pointer; box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), inset 0 0 5px rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; gap: 6px; position: relative; overflow: hidden; text-decoration: none;
}
.magic-btn-small::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}
.magic-btn-small:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 10px rgba(59, 130, 246, 0.8); }
.magic-btn-small:hover::before { left: 100%; }

#notification-full-panel {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background-color: rgba(0, 0, 0, 0.95); backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
#notification-full-panel.open { opacity: 1; visibility: visible; }

/* --- BOTÃO VOLTAR MÁGICO --- */
.btn-back-magic {
    display: flex; align-items: center; gap: 10px;
    background: rgba(30, 41, 59, 0.6); 
    color: #e2e8f0;
    padding: 10px 24px; 
    border-radius: 12px; 
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 700; 
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-back-magic i {
    transition: transform 0.3s ease;
    color: #60a5fa;
}

.btn-back-magic:hover {
    background: rgba(59, 130, 246, 0.15); 
    border-color: #3b82f6;
    color: white; 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.btn-back-magic:hover i {
    transform: translateX(-4px); /* Seta move para trás */
    color: white;
}

.bulk-delete-btn-top {
    display: flex;
    align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    color: white; border: none; padding: 10px 20px; border-radius: 12px;
    cursor: pointer; font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.2); transition: all 0.3s ease;
    border: 1px solid #ef4444;
}
.bulk-delete-btn-top:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}
.bulk-delete-btn-top.hidden { display: none !important; }

.magic-title-text {
    font-size: 1.25rem; font-weight: 900; color: white;
    text-transform: uppercase; letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #93c5fd);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}
.magic-icon-container {
    color: #60a5fa; font-size: 1.4rem;
    filter: drop-shadow(0 0 8px #3b82f6);
    animation: floatIcon 3s ease-in-out infinite;
}

.magic-clock-energy {
    font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.1rem;
    color: #bae6fd;
    text-shadow: 0 0 8px rgba(186, 230, 253, 0.5);
    background: rgba(15, 23, 42, 0.8); padding: 8px 16px; border-radius: 50px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex; align-items: center; gap: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    height: 42px;
}
.clock-icon-pulse {
    color: #38bdf8;
    animation: energyPulse 2s infinite ease-in-out;
}

/* --- BARRA DE PESQUISA (MAGIC CAPSULE) --- */
.magic-search-wrapper {
    display: flex; 
    align-items: center; 
    background: rgba(15, 23, 42, 0.6);
    border-radius: 99px; 
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    height: 42px; /* Altura fixa */
    overflow: hidden; /* Garante que input não vaze */
    
    /* FIX DE ALINHAMENTO: Garante que os filhos fiquem lado a lado corretamente */
    justify-content: flex-start;
}

/* Estado Expandido */
.magic-search-wrapper.active {
    background: rgba(15, 23, 42, 0.95); 
    border-color: #3b82f6; 
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
    width: 280px; 
}

/* Estado Colapsado */
.magic-search-wrapper:not(.active) {
    width: 42px; 
    background: transparent;
    border-color: transparent;
}
.magic-search-wrapper:not(.active):hover {
    background: rgba(255,255,255,0.05);
}

/* FIX: INPUT LIMPO E ALINHADO (ZERO ESPAÇAMENTO ESQUERDO) */
.magic-search-input {
    width: 0; 
    opacity: 0; 
    border: none !important; /* Remove borda nativa */
    outline: none !important; /* Remove anel de foco */
    box-shadow: none !important; /* Remove sombras extras */
    appearance: none !important; /* Remove estilos de SO */
    background: transparent !important; 
    color: white;
    font-size: 0.9rem; 
    
    /* FIX CRÍTICO: Zera qualquer padding ou indentação que empurre o texto */
    padding: 0 !important; 
    margin: 0 !important;
    text-indent: 0 !important;
    text-align: left !important;
    
    /* Puxa o texto levemente para a esquerda para compensar o espaço visual do ícone */
    margin-left: -2px !important; 

    transition: all 0.4s ease;
    height: 100%;
    
    /* FIX DE ALINHAMENTO TEXTO */
    flex-grow: 1; /* Ocupa o resto do espaço */
    line-height: normal; /* Reseta altura de linha */
}

.magic-search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.magic-search-wrapper.active .magic-search-input { 
    width: auto; /* Deixa o flex-grow cuidar do tamanho */
    opacity: 1; 
    /* Padding apenas na direita para não colar no final */
    padding-right: 12px !important; 
    padding-left: 0 !important; /* Garante zero à esquerda */
}

.magic-icon-btn {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: transparent; color: #94a3b8; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; font-size: 1rem; flex-shrink: 0; /* Não encolher */
    
    /* FIX: Remove margem para aproximar input */
    margin-right: 0 !important; 
}
.magic-icon-btn:hover { color: white; }
.magic-search-wrapper.active .magic-icon-btn { color: #60a5fa; }

#magic-filter-btn {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
}
#magic-filter-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
#magic-filter-btn.active { color: #ec4899; background: rgba(236, 72, 153, 0.15); border-color: #ec4899; }

/* Modais e Elementos Gerais */
#custom-confirm-modal { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: all 0.3s ease; }
#custom-confirm-modal.visible { opacity: 1; visibility: visible; }
.custom-modal-content { background: #1e293b; border: 1px solid #475569; border-radius: 16px; padding: 24px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
#custom-confirm-modal.visible .custom-modal-content { transform: scale(1); }
.modal-icon-warning { font-size: 3rem; color: #fbbf24; margin-bottom: 1rem; filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3)); animation: bounceSmall 2s infinite; }
.custom-modal-title { font-size: 1.25rem; font-weight: 700; color: white; margin-bottom: 0.5rem; }
.custom-modal-text { color: #94a3b8; font-size: 0.95rem; margin-bottom: 1.5rem; }
.custom-modal-actions { display: flex; gap: 1rem; justify-content: center; }
.btn-modal-cancel { background: transparent; border: 1px solid #475569; color: #cbd5e1; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-modal-cancel:hover { background: rgba(255,255,255,0.05); color: white; }
.btn-modal-confirm { background: linear-gradient(135deg, #ef4444, #b91c1c); border: none; color: white; padding: 10px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); transition: all 0.2s; }
.btn-modal-confirm:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5); }

.empty-state-magic { text-align: center; }
.empty-icon-wrapper {
    position: relative; font-size: 5rem; color: #1e293b;
    display: flex; justify-content: center;
    transition: all 0.5s ease;
}
.empty-icon-wrapper i {
    z-index: 2; position: relative;
    background: linear-gradient(180deg, #475569, #1e293b);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    animation: floatIcon 4s ease-in-out infinite;
}
.empty-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100px; height: 100px; background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    z-index: 1; animation: glowPulse 3s infinite alternate;
}

.panel-tabs { display: flex; border-bottom: 1px solid var(--notif-border); background: #1e293b; padding: 0 20px; }
.panel-tab-item {
    padding: 18px 30px; cursor: pointer; color: var(--notif-text-muted); font-weight: 600; font-size: 0.95rem;
    border-bottom: 3px solid transparent; transition: all 0.3s; display: flex; align-items: center; gap: 10px;
}
.panel-tab-item:hover { color: #e2e8f0; background: rgba(255,255,255,0.02); }
.panel-tab-item.active { 
    color: #60a5fa; border-bottom-color: #60a5fa; 
    background: linear-gradient(to top, rgba(59, 130, 246, 0.1), transparent);
}
.panel-tab-item.tab-importantes.active {
    color: #fbbf24; border-bottom-color: #fbbf24;
    background: linear-gradient(to top, rgba(251, 191, 36, 0.1), transparent);
}

.notif-sidebar { width: 420px; background-color: var(--notif-bg-dark); border-right: 1px solid var(--notif-border); display: flex; flex-direction: column; overflow-y: auto; position: relative; }
.notif-item { 
    padding: 1.25rem; border-bottom: none; cursor: pointer; transition: all 0.2s; 
    display: flex; gap: 1rem; align-items: flex-start; position: relative; padding-bottom: 1.5rem;
}
.notif-item:hover { background-color: rgba(30, 41, 59, 0.8); }
.notif-item::after {
    content: ''; position: absolute; bottom: 0; left: 5%; width: 90%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), rgba(236, 72, 153, 0.4), transparent);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

.notif-item.active { 
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(30, 41, 59, 0.8));
    border-left: 4px solid #60a5fa; 
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.notif-item.active .notif-item-title {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.featured-item-gold { background: linear-gradient(90deg, rgba(245, 158, 11, 0.05), rgba(15, 23, 42, 0.4)); }
.featured-item-gold::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #f59e0b, #fbbf24); box-shadow: 2px 0 15px rgba(245, 158, 11, 0.5); z-index: 5; }
.featured-item-gold .notif-item-title { color: #fcd34d !important; text-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }

.notif-item.magic-unread { background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(15, 23, 42, 0.4)); border-left: 4px solid transparent; overflow: hidden; }
.notif-item.magic-unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #3b82f6, #ec4899); box-shadow: 2px 0 15px rgba(59, 130, 246, 0.8); z-index: 5; }
.notif-item.magic-unread::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: magicShine 3s infinite linear; z-index: 1; }

.btn-magic-action {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 32px; border-radius: 12px; color: white; font-weight: 700; text-decoration: none;
    overflow: hidden; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); transition: transform 0.3s;
}
.btn-magic-action:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5); }

.btn-magic-delete {
    background: transparent; color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 10px 24px; border-radius: 99px; font-weight: 600; cursor: pointer;
    transition: all 0.3s; display: flex; align-items: center; gap: 8px;
}
.btn-magic-delete:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; transform: scale(1.02); box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }

.magic-loader-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; min-height: 200px; padding: 40px; }
.magic-loader-orb {
    width: 60px; height: 60px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #60a5fa, #3b82f6);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6); position: relative;
    animation: orbFloat 2s ease-in-out infinite; display: flex; align-items: center; justify-content: center;
}
.magic-loader-icon { font-size: 1.8rem; color: #ffffff; filter: drop-shadow(0 0 5px #60a5fa); animation: boltPulse 1.5s ease-in-out infinite alternate; z-index: 10; }
.magic-loader-orb::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid transparent; border-top-color: #ec4899; border-right-color: #8b5cf6; animation: spinReverse 1.5s linear infinite; }
.magic-loader-orb::after { content: ''; position: absolute; inset: -15px; border-radius: 50%; border: 2px solid transparent; border-bottom-color: #3b82f6; border-left-color: #06b6d4; animation: spin 2.5s linear infinite; }
.magic-loader-text { margin-top: 25px; color: #93c5fd; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; animation: pulse 1.5s infinite; font-weight: 600; text-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }

.magic-date-badge {
    background: #1e293b;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    padding: 4px 8px; 
    border-radius: 6px;
    font-size: 0.75rem; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#msg-star-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#msg-star-btn:hover {
    background-color: rgba(55, 65, 81, 0.8);
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spinReverse { 100% { transform: rotate(-360deg); } }
@keyframes magicShine { 0% { left: -100%; } 20% { left: 100%; } 100% { left: 100%; } }
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes energyPulse { 0% { transform: scale(1); filter: drop-shadow(0 0 2px #38bdf8); } 50% { transform: scale(1.2); filter: drop-shadow(0 0 8px #38bdf8); } 100% { transform: scale(1); filter: drop-shadow(0 0 2px #38bdf8); } }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes orbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes glowPulse { 0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounceSmall { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes boltPulse { 0% { transform: scale(0.9); opacity: 0.8; text-shadow: 0 0 10px rgba(255,255,255,0.5); } 100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 20px rgba(255,255,255,0.9), 0 0 10px #3b82f6; } }
@keyframes shine { 100% { transform: translateX(100%) skewX(12deg); } }
.animate-shine { animation: shine 2s infinite; }

.loading-spinner { text-align: center; padding: 20px; color: #60a5fa; font-size: 0.9rem; display: none; width: 100%; font-weight: 500; }
.loading-spinner.visible { display: block; animation: pulse 1.5s infinite; }

@media (max-width: 768px) {
    .btn-back-mobile { display: inline-flex; }
    .notif-sidebar { width: 100%; border-right: none; }
    .notif-content-view {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background-color: var(--notif-bg-dark); z-index: 50;
        transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.5rem; display: block;
    }
    .notif-content-view.active { transform: translateX(0); }
    .magic-clock-energy { font-size: 0.9rem; padding: 4px 8px; }
    .panel-tabs { justify-content: center; }
    .panel-tab-item { padding: 12px 15px; font-size: 0.85rem; }
    .bulk-text { display: none; }
}