/**
 * ========================================
 * ESTILOS FASE 2 - EJA v5.1.0
 * ========================================
 * 
 * Estilos para:
 * - Modal de busca global
 * - Lightbox de galeria
 * - Bottom navigation mobile
 * - Pull-to-refresh
 * - Badge de notificações
 * 
 * Data: 19/02/2026
 * Atualização: Removido FullCalendar e Theme Switcher
 */

/* ========================================
   MODAL DE BUSCA GLOBAL
   ======================================== */

#modal-busca-global {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    backdrop-filter: blur(4px);
}

#modal-busca-global.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.busca-container {
    background: var(--surface-color, #fff);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

.busca-input-wrapper {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.busca-input-wrapper i {
    font-size: 1.25rem;
    color: var(--text-secondary, #6b7280);
}

#busca-global-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.125rem;
    background: transparent;
    color: var(--text-primary, #111827);
}

#resultados-busca-global {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.resultado-busca-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.resultado-busca-item:hover {
    background: var(--hover-color, #f3f4f6);
    transform: translateX(4px);
}

.resultado-icone {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #e0e7ff);
    border-radius: 10px;
}

.resultado-conteudo {
    flex: 1;
}

.resultado-titulo {
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.25rem;
}

.resultado-descricao {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.resultado-seta {
    color: var(--text-secondary, #6b7280);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resultado-busca-item:hover .resultado-seta {
    opacity: 1;
}

.busca-categoria {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary, #6b7280);
    padding: 1rem 0 0.5rem;
    letter-spacing: 0.05em;
}

.busca-placeholder, .busca-vazia {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary, #6b7280);
}

.busca-placeholder i, .busca-vazia i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

mark {
    background: #fef08a;
    color: #854d0e;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ========================================
   LIGHTBOX DE GALERIA
   ======================================== */

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-btn {
    position: absolute;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.lightbox-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-toolbar {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    background: rgba(0,0,0,0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.lightbox-tool-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.lightbox-tool-btn:hover {
    transform: scale(1.2);
}

.lightbox-counter {
    color: white;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.lightbox-info {
    position: absolute;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(10px);
}

/* ========================================
   BOTTOM NAVIGATION MOBILE
   ======================================== */

.bottom-nav-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface-color, #fff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding: 0.5rem;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .bottom-nav-mobile {
        display: flex;
    }
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 80px;
}

.bottom-nav-btn i {
    font-size: 1.25rem;
}

.bottom-nav-btn span {
    font-size: 0.75rem;
}

.bottom-nav-btn.active {
    color: var(--primary-color, #6366f1);
    background: var(--primary-light, #eef2ff);
}

.bottom-nav-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6366f1), var(--primary-dark, #4f46e5));
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    margin: 0 0.5rem;
    flex: 0;
}

.bottom-nav-fab i {
    font-size: 1.5rem;
}

.bottom-nav-fab span {
    display: none;
}

/* ========================================
   PULL-TO-REFRESH
   ======================================== */

.pull-refresh-indicator {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color, #fff);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pull-spinner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color, #6366f1);
}

.pull-spinner i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

.pull-refresh-indicator.refreshing .pull-spinner i {
    animation: spin 0.5s linear infinite;
}

/* ========================================
   BADGE DE NOTIFICAÇÕES
   ======================================== */

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

.notification-badge.pulse {
    animation: pulse 1s ease;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   HIGHLIGHT PULSE (para busca)
   ======================================== */

.highlight-pulse {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        background: transparent;
        box-shadow: none;
    }
    50% {
        background: rgba(250,204,21,0.2);
        box-shadow: 0 0 0 4px rgba(250,204,21,0.3);
    }
}

/* ========================================
   DRAG & DROP UPLOAD
   ======================================== */

.drag-over {
    border: 3px dashed var(--primary-color, #6366f1) !important;
    background: rgba(99,102,241,0.05) !important;
    position: relative;
}

.drag-over::after {
    content: '📎 Solte a imagem aqui';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--primary-color, #6366f1);
    font-weight: 600;
    pointer-events: none;
    z-index: 100;
}

/* ========================================
   RESPONSIVO
   ======================================== */

@media (max-width: 768px) {
    .busca-container {
        width: 95%;
        max-height: 80vh;
    }
    
    .lightbox-btn {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .lightbox-toolbar {
        bottom: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .lightbox-tool-btn {
        padding: 0.25rem;
    }
}
