:root { 
    --primary: #1a237e; 
    --primary-accent: #1a237e;
    --secondary: #2e7d32; 
    --bg: #f4f7f6; 
    --card-bg: #ffffff;
    --card: #ffffff;
    --border: #e2e8f0;
    --text-main: #1c1c1c;
    --text-muted: #575757;
    --radius: 14px; /* Reduzido de 18px para visual mais compacto */
    --header-gradient: linear-gradient(135deg, #0d1240 0%, #1a237e 100%);
    --success: #2e7d32;
    --warning: #f59e0b;
    --danger: #d32f2f;
    --info: #0288d1;
    --accent-fire: #e65100;
}

/* Redução Global da Escala (Corrige diferença Acode vs Navegador) */
html {
    font-size: 88%; /* Normaliza o tamanho base no navegador */
}

/* Modo Escuro Global */
body.dark-mode {
    --bg: #121212;
    --card-bg: #1e1e1e;
    --card: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #a3a3a3;
    --border: rgba(255, 255, 255, 0.08);
    --secondary: #81c784;
}

body.dark-mode .timeline-table th {
    background: #181818;
    color: var(--text-muted);
}

body.dark-mode .tr-active { 
    background: rgba(255, 255, 255, 0.03) !important; 
}

body.dark-mode .related-card,
body.dark-mode .news-card,
body.dark-mode .radar-container-wrapper,
body.dark-mode .table-timeline-wrapper {
    background: var(--card-bg);
    border-color: var(--border);
}

body.dark-mode .related-detail b {
    color: var(--text-main);
}

/* Estrutura Geral */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding: 75px 0 0 0 !important; /* Reduzido de 75px */
    color: var(--text-main); 
    -webkit-font-smoothing: antialiased; 
    text-rendering: optimizeLegibility;
    transition: background 0.3s, color 0.3s; 
}

.container { 
    max-width: 1000px; /* Reduzido de 1080px */
    margin: 0 auto; 
    padding: 0 14px 40px 14px; 
    min-height: 80vh;
}

.page-section {
    margin-top: 22px;
}

/* CABEÇALHO HERO */
.aircraft-hero-card {
    background: var(--header-gradient);
    border-radius: var(--radius);
    padding: 18px; /* Reduzido de 24px */
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transition: background 0.5s ease;
}

.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.hero-badge-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-badge {
    background: var(--success);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.62rem; /* Reduzido de 0.68rem */
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cia-tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.last-update-tag {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-title-area h1 {
    font-size: 1.75rem; /* Reduzido de 2.2rem */
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* ÁREA DE MODELOS NO CABEÇALHO */
.model-history-container {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-title-area h2#ac-model {
    font-size: 1.15rem; /* Reduzido de 1.35rem */
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: inline-block;
    transition: opacity 0.2s;
}

.hero-title-area h2#ac-model.active-filter {
    text-decoration: underline;
    color: #60a5fa;
}

.model-history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.model-history-item {
    font-size: 0.75rem; /* Reduzido de 0.82rem */
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s, color 0.2s;
    width: fit-content;
}

.model-history-item:hover {
    color: #ffffff;
    opacity: 1;
}

.model-history-item.active-filter {
    color: #60a5fa;
    opacity: 1;
    font-weight: 700;
}

.model-history-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.model-history-val {
    font-weight: 700;
}

.model-history-reset {
    margin-top: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #93c5fd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-history-reset:hover {
    text-decoration: underline;
}

.hero-title-area .livery-subtitle {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fca5a5;
    text-transform: uppercase;
}

.hero-title-area .batismo-subtitle {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.78rem;
    font-weight: 700;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 8px;
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px;
}

.stat-box .label {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.stat-box .val {
    font-size: 0.82rem; /* Reduzido de 0.92rem */
    font-weight: 800;
    color: #ffffff;
}

.hero-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn-hero-action {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero-action:hover {
    background: #ffffff;
    color: var(--primary);
}

/* CAIXA DE AVISO */
.notice-box {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning);
    padding: 10px 12px;
    margin-top: 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-main);
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.notice-icon {
    color: var(--warning);
    margin-top: 2px;
}

/* SEÇÃO E TÍTULOS */
.section-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 0.82rem; /* Reduzido de 0.92rem */
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* TABELA LINHA DO TEMPO */
.table-timeline-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    overflow-x: auto;
    position: relative;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.timeline-table th {
    background: var(--bg);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.timeline-table th.col-node-header {
    width: 28px;
    padding: 0;
}

.timeline-table td {
    padding: 10px 12px; /* Reduzido o espaçamento vertical */
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem; /* Reduzido de 0.85rem */
    color: var(--text-main);
    vertical-align: top;
}

.timeline-table tr:last-child td {
    border-bottom: none;
}

.col-node {
    width: 28px;
    padding: 0 !important;
    text-align: center;
    position: relative;
}

.col-node::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--border);
    z-index: 1;
}

.timeline-table tr:first-child .col-node::before { 
    top: 18px; 
}

.timeline-table tr:last-child .col-node::before { 
    bottom: calc(100% - 18px); 
}

.timeline-table tr:first-child:last-child .col-node::before {
    display: none;
}

.timeline-dot {
    width: 8px; /* Reduzido de 10px */
    height: 8px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--text-muted);
    display: inline-block;
    position: relative;
    z-index: 2;
    margin-top: 14px;
    box-sizing: border-box;
}

.timeline-dot.dot-vazado,
.timeline-dot.dot-nao-entregue,
.timeline-dot.dot-fora {
    background: transparent !important;
    box-shadow: none !important;
}

.timeline-dot.dot-vazado { border-color: var(--text-muted); }
.timeline-dot.dot-nao-entregue { border-color: var(--border); }
.timeline-dot.dot-operacao { 
    border-color: var(--success); 
    background: var(--success); 
    animation: pulse-dot 2s infinite;
}

.timeline-dot.dot-estocado { border-color: var(--warning); background: var(--warning); }
.timeline-dot.dot-manutencao { border-color: #eab308; background: #eab308; }
.timeline-dot.dot-fora { border-color: var(--danger); }
.timeline-dot.dot-futura { border-color: var(--info); background: var(--info); }

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.tr-active { background: rgba(26, 35, 126, 0.03); }
.reg-code { font-weight: 800; font-size: 0.82rem; display: block; }
.op-name { font-weight: 700; display: block; }

.row-not-delivered, .row-registered { opacity: 0.65; }
.row-future { background: rgba(30, 41, 59, 0.02); }

/* LEASE & TAGS */
.lease-wrapper { margin-top: 3px; display: flex; flex-direction: column; gap: 2px; }
.lease-type-tag { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.lease-type-tag.wet { color: #d97706; }
.lease-type-tag.dry { color: #2563eb; }
.lease-company-subtext { font-size: 0.62rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }
.lease-company-subtext strong { color: var(--text-main); font-weight: 700; }

/* GALERIA DE FOTOS */
.btn-enviar-foto {
    background: var(--primary);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

.btn-enviar-foto:hover {
    opacity: 0.9;
}

.photo-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
}
.photo-grid::-webkit-scrollbar { display: none; }

.spotter-featured-card {
    min-width: 85%;
    flex: 0 0 85%;
    scroll-snap-align: start;
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0f172a;
    text-decoration: none;
}

@media(min-width: 769px) {
    .photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
    .spotter-featured-card { min-width: unset; flex: unset; }
}

.spotter-featured-card img { width: 100%; height: 100%; object-fit: cover; }
.spotter-card-overlay {
    position: absolute; 
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end; 
    padding: 12px;
}

.spotter-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 2;
}

.spotter-card-title { 
    color: #ffffff !important; 
    font-size: 0.85rem !important; 
    font-weight: 800 !important; 
    margin: 0 !important; 
    line-height: 1.2 !important;
}

.spotter-card-sub { 
    color: rgba(255, 255, 255, 0.8) !important; 
    font-size: 0.65rem !important; 
    font-weight: 600 !important; 
    text-transform: uppercase !important; 
    margin: 2px 0 0 0 !important; 
}

.spotter-card-copyright {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.6rem !important;
    font-weight: 500 !important;
    margin-top: 3px !important;
}

/* RELACIONADAS GRID */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Reduzido de 210px */
    gap: 12px;
}

.related-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.related-img-container { 
    width: 100%; 
    aspect-ratio: 16/9; 
    background: #0f172a; 
    position: relative; 
}

.related-img-container img { width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 10px; }
.related-model { font-size: 0.72rem; font-weight: 800; color: var(--primary); text-transform: uppercase; display: block; margin-bottom: 4px; }
.related-detail { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 2px; }
.related-detail b { color: var(--text-main); }

/* RADAR E NOTÍCIAS */
.radar-container-wrapper {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.radar-iframe-container {
    position: relative;
    width: 100%;
    padding-top: 55%;
}

@media (min-width: 768px) {
    .radar-iframe-container {
        padding-top: 420px;
    }
}

.radar-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.feed-container { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 768px) { .feed-container { grid-template-columns: 1fr 1fr; } }

.news-card { 
    display: flex; 
    background: var(--card-bg); 
    padding: 8px; 
    border-radius: 10px; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.03); 
    cursor: pointer; 
    border: 1px solid var(--border); 
    transition: border-color 0.2s ease, transform 0.2s ease; 
    text-decoration: none; 
    color: inherit; 
}

.news-card:hover { 
    border-color: var(--primary); 
    transform: translateY(-2px);
}

.news-card img { width: 80px; height: 58px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.news-content { margin-left: 10px; display: flex; flex-direction: column; justify-content: center; width: 100%; }
.news-content h4 { font-size: 0.8rem; font-weight: 600; margin: 0 0 3px 0; line-height: 1.2; color: var(--text-main); }
.news-meta { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.news-meta .author { font-weight: 600; color: var(--primary); }
.news-meta .dot { width: 3px; height: 3px; background: #ccc; border-radius: 50%; }

/* SKELETON LOADING */
.skeleton { background: #e2e8f0; animation: skeleton-pulse 1.5s infinite ease-in-out; border-radius: 6px; display: inline-block; }
body.dark-mode .skeleton { background: #1e293b; }
.skeleton-text { height: 0.9rem; width: 80px; }
.skeleton-card { width: 100%; height: 150px; border-radius: var(--radius); }
@keyframes skeleton-pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* RESPONSIVIDADE */
@media(max-width: 768px) {
    html { font-size: 84%; } /* Encolhe ligeiramente no mobile para evitar 'estouro' de layout */
    .container { padding-bottom: 30px; }
    .hero-title-area h1 { font-size: 1.45rem; }
    .hero-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .aircraft-hero-card { padding: 14px; }
}
