:root {
    --primary-color: #007bff;
    --primary-dark: #1a3c5e;
    --accent-yellow: #f1c40f;
    --dark-bg: #1a1a1a;
    --light-gray: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 1. ESTRUTURA GERAL */
.ficha-tecnica-container {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #333;
    background-color: #fff;
    padding-bottom: 80px;
}

.topo-fichatecnica {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 100px;
}

.header-text-group {
    flex: 1;
    text-align: left;
}

.header-logo-group {
    flex-shrink: 0;
    margin-left: 30px;
}

.technical-logo {
    max-height: 160px;
    max-width: 300px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

.custom-section-title {
    font-size: 2.2rem;
    color: var(--primary-dark);
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
    display: inline-block;
}

.custom-section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-yellow));
    border-radius: 3px;
}

/* 2. QUADRO EVOLUTIVO (VERTICAL) */
.quadro-wrapper {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-quadro-final {
    width: 100% !important;
    margin-bottom: 0;
    border-collapse: collapse !important;
    table-layout: fixed;
    /* Ajuda a manter as proporções das colunas */
}

.table-quadro-final th,
.table-quadro-final td {
    border: 1px solid var(--border-color) !important;
    padding: 15px !important;
    vertical-align: middle !important;
    text-align: center;
    word-wrap: break-word;
}

.table-quadro-final thead th {
    background-color: var(--primary-dark);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.data-header {
    color: #fff;
    font-weight: 700 !important;
    font-size: 0.9rem;
}

/* 3. LINHA DO TEMPO (ESCALA) */
.timeline-scale-wrapper {
    position: relative;
    height: 140px;
    margin: 40px 40px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #eee;
    transform: translateY(-50%);
    border-radius: 4px;
}

.timeline-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.point-dot {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.point-year {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary-dark);
}

.timeline-point:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

/* Destaque do Ano Ativo */
.timeline-point.active { z-index: 50; }
.timeline-point.active .point-dot {
    transform: scale(1.6);
    background: var(--primary-dark) !important;
    border: 3px solid var(--accent-yellow) !important;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}
.timeline-point.active .point-year {
    color: var(--primary-color);
    font-size: 1.1rem;
    top: 38px;
}

/* 4. DETALHE DA CRONOLOGIA (GRELHA INTELIGENTE / PUZZLE) */
#chrono-detail-card {
    margin-top: 50px;
    background: transparent !important;
    box-shadow: none !important;
}

#chrono-detail-card .card-header {
    background: var(--primary-dark);
    margin-bottom: 25px;
    border: none;
    padding: 20px 10px 10px 10px;
    margin-bottom: 0 !important;
    text-align: center;
}

#chrono-events-container {
    display: grid;
    /* Define colunas que se ajustam sozinhas */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* O segredo do puzzle: tenta preencher todos os espaços vazios */
    grid-auto-flow: dense;
    gap: 20px;
    padding: 10px 0;
    background-color: var(--primary-dark);
}

.event-card-small {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
}

.event-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* Classes de inteligência de tamanho (aplicadas via JS) */
.grid-col-2 {
    grid-column: span 2;
}

.grid-row-2 {
    grid-row: span 2;
}

.event-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
}

/* Se o card for row-span 2 e col-span 2, a imagem pode ser maior */
.grid-row-2 .event-card-img {
    height: 300px;
}

.event-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.event-card-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #0d47a1;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    align-self: flex-start;
}

.event-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

/* 5. CARROSSEIS (MARCAS E MODELOS) - COM BORDA LEVE */

/* Remove fundos de cor das secções */
section.bg-light {
    background-color: #ffffff !important;
}

.ficha-carousel {
    padding: 20px 0 40px 0;
    margin: 0 -15px;
}

/* Lógica de altura igual */
.ficha-carousel .slick-track {
    display: flex !important;
    align-items: stretch !important;
}

.ficha-carousel .slick-slide {
    height: auto !important;
    display: flex !important;
}

.carousel-slide-wrapper {
    padding: 0 15px;
    display: flex !important;
    flex-direction: column;
    flex: 1;
}

/* O CARD: Com borda leve cinzenta e sem sombra */
.card-zoom {
    background: #fff;
    border-radius: 15px;
    /* Borda leve cinzenta no contorno */
    border: 1px solid #eeeeee !important;
    box-shadow: none !important;
    transition: var(--transition);
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    flex: 1;
    width: 100%;
    margin-top: 10px;
}

/* HOVER: Leve levantamento sem sombra */
.card-zoom:hover {
    transform: translateY(-5px);
    box-shadow: none !important;
    /* Opcional: Escurecer a borda levemente no hover para feedback visual */
    border-color: #e0e0e0 !important;
}

/* Container da Imagem: Com borda cinzenta na base (divisor) */
.img-container {
    height: 240px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    /* Linha cinzenta que divide imagem e texto */
    border-bottom: 1px solid #eeeeee !important;
    flex-shrink: 0;
}

.img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.card-zoom:hover .img-container img {
    transform: scale(1.03);
}

/* Corpo do Card */
.card-body {
    padding: 20px 25px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.card-body h5 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 10px;
}

.card-body .text-muted {
    font-size: 0.88rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* 6. RESPONSIVIDADE */
@media (max-width: 992px) {
    #chrono-events-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .topo-fichatecnica {
        flex-direction: column;
        text-align: center;
    }

    .header-logo-group {
        margin-bottom: 20px;
    }

    .timeline-scale-wrapper {
        margin: 60px 20px;
    }

    .display-3 {
        font-size: 2.2rem;
    }

    .table-quadro-final {
        min-width: 800px;
    }
}

/* Estilo dos Dots */
.slick-dots li button:before {
    font-size: 8px !important;
    color: var(--primary-dark) !important;
    opacity: 0.2;
}

.slick-dots li.slick-active button:before {
    opacity: 0.8;
}