/* ═══════════════════════════════════════════════════════════════════════════
   novidades.css — Modal de Novidades do Sistema · Capacitar CODEMAR
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Botão flutuante de acesso rápido ──────────────────────────────────────── */
#novidades-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0D8ABC, #0369a1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(13, 138, 188, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
#novidades-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(13, 138, 188, 0.55);
}
#novidades-fab .novidades-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: novidades-pulse 2s ease-in-out infinite;
}
@keyframes novidades-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

/* ── Overlay ───────────────────────────────────────────────────────────────── */
#novidades-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
#novidades-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal container ───────────────────────────────────────────────────────── */
#novidades-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
#novidades-overlay.open #novidades-modal {
    transform: translateY(0) scale(1);
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.novidades-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    padding: 24px 28px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}
.novidades-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.novidades-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(13, 138, 188, 0.25);
    border: 1px solid rgba(13, 138, 188, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.novidades-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.novidades-header-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
    margin: 0;
}
.novidades-header-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}
.novidades-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.novidades-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── Tabs de versão ────────────────────────────────────────────────────────── */
.novidades-version-tabs {
    display: flex;
    gap: 6px;
    padding: 14px 28px 0;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.novidades-version-tabs::-webkit-scrollbar { display: none; }

.novidades-version-tab {
    padding: 7px 14px;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
    bottom: -1px;
}
.novidades-version-tab:hover {
    color: #0D8ABC;
    background: #f0f9ff;
}
.novidades-version-tab.active {
    color: #0D8ABC;
    background: #ffffff;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
}
.novidades-version-tab .tab-version-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    margin-left: 4px;
}
.novidades-version-tab.active .tab-version-badge {
    background: #0D8ABC;
    color: white;
}

/* ── Corpo do modal ────────────────────────────────────────────────────────── */
.novidades-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.novidades-body::-webkit-scrollbar { width: 5px; }
.novidades-body::-webkit-scrollbar-track { background: transparent; }
.novidades-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ── Painel de versão ──────────────────────────────────────────────────────── */
.novidades-version-panel {
    display: none;
    padding: 20px 28px 24px;
    animation: novidades-fade-in 0.2s ease;
}
.novidades-version-panel.active {
    display: block;
}
@keyframes novidades-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Cabeçalho da versão ────────────────────────────────────────────────────── */
.novidades-version-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.novidades-version-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px 0;
}
.novidades-version-highlight {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}
.novidades-version-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.novidades-version-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
}
.novidades-version-date {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ── Itens de novidade ──────────────────────────────────────────────────────── */
.novidades-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.novidades-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    background: #fafafa;
    transition: box-shadow 0.15s;
}
.novidades-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

/* Ícone da categoria */
.novidades-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.novidades-item-icon.destaque  { background: #fef3c7; color: #d97706; }
.novidades-item-icon.novo      { background: #dcfce7; color: #16a34a; }
.novidades-item-icon.melhoria  { background: #dbeafe; color: #2563eb; }
.novidades-item-icon.correcao  { background: #fee2e2; color: #dc2626; }
.novidades-item-icon.seguranca { background: #f3e8ff; color: #9333ea; }

/* Badge da categoria */
.novidades-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}
.novidades-item-badge.destaque  { background: #fef3c7; color: #92400e; }
.novidades-item-badge.novo      { background: #dcfce7; color: #14532d; }
.novidades-item-badge.melhoria  { background: #dbeafe; color: #1e40af; }
.novidades-item-badge.correcao  { background: #fee2e2; color: #991b1b; }
.novidades-item-badge.seguranca { background: #f3e8ff; color: #6b21a8; }

.novidades-item-content {
    flex: 1;
    min-width: 0;
}
.novidades-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 3px 0;
    line-height: 1.35;
}
.novidades-item-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* ── Footer do modal ───────────────────────────────────────────────────────── */
.novidades-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.novidades-footer-left {
    font-size: 0.72rem;
    color: #94a3b8;
}
.novidades-footer-left strong {
    color: #64748b;
}
.novidades-footer-btn {
    padding: 8px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #0D8ABC, #0369a1);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.novidades-footer-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] #novidades-modal {
    background: #1e293b;
}
[data-theme="dark"] .novidades-version-tabs {
    border-bottom-color: #334155;
}
[data-theme="dark"] .novidades-version-tab {
    color: #94a3b8;
}
[data-theme="dark"] .novidades-version-tab.active {
    background: #1e293b;
    border-color: #334155;
    border-bottom-color: #1e293b;
    color: #38bdf8;
}
[data-theme="dark"] .novidades-version-panel {
    background: transparent;
}
[data-theme="dark"] .novidades-version-header {
    border-bottom-color: #334155;
}
[data-theme="dark"] .novidades-version-title {
    color: #f1f5f9;
}
[data-theme="dark"] .novidades-item {
    background: #263347;
    border-color: #334155;
}
[data-theme="dark"] .novidades-item:hover {
    background: #2d3f55;
}
[data-theme="dark"] .novidades-item-title {
    color: #e2e8f0;
}
[data-theme="dark"] .novidades-item-desc {
    color: #94a3b8;
}
[data-theme="dark"] .novidades-footer {
    border-top-color: #334155;
}

/* ── Responsividade ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #novidades-modal {
        max-height: 95vh;
        border-radius: 16px;
    }
    .novidades-header {
        padding: 18px 20px 14px;
    }
    .novidades-version-panel {
        padding: 16px 20px 20px;
    }
    .novidades-footer {
        padding: 12px 20px;
    }
    #novidades-fab {
        bottom: 20px;
        right: 20px;
    }
}
