:root {
    --header-height: 72px;
    --tabs-height: 48px;
    --footer-height: 48px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;

    /* Espaço para header + abas */
    padding-top: calc(var(--header-height) + var(--tabs-height));

    /* Espaço para o footer */
    padding-bottom: var(--footer-height);
}

.container {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================
   HEADER
========================= */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;

    display: flex;
    align-items: center;

    background: linear-gradient(135deg, #1a2a6c 0%, #2a5298 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    font-size: 1.55rem;
    line-height: 1.2;
}

header h1 i {
    font-size: 1.4rem;
}

/* =========================
   CONTEÚDO PRINCIPAL
========================= */

main {
    width: 100%;
}

.tabs-container {
    width: 100%;
}

/* =========================
   ABAS FIXAS
========================= */

.tab-header {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: var(--tabs-height);
    z-index: 999;

    display: flex;

    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.tab-button {
    flex: 1;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 10px;
    border: none;
    background: transparent;
    color: #ecf0f1;

    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.tab-button i {
    font-size: 0.9rem;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
    position: relative;
    color: white;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.tab-button.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 3px;
    background: #5dade2;
}

/* =========================
   CONTEÚDO DAS ABAS
========================= */

.tab-content {
    display: none;
    width: 100%;
    padding: 28px 0 35px;

    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    margin-bottom: 24px;

    color: #2c3e50;
    font-size: 1.55rem;
    text-align: center;
}

h2 i {
    color: #3498db;
    font-size: 1.35rem;
}

/* =========================
   VISÃO GERAL
========================= */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.overview-card {
    min-height: 185px;
    padding: 22px 14px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.overview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.11);
}

.icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    font-size: 1.35rem;
}

.overview-card h3 {
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.3;
}

.overview-card p {
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* =========================
   FASES
========================= */

.phase {
    position: relative;

    margin-bottom: 15px;
    padding: 20px;

    background: white;
    border-left: 4px solid #e74c3c;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.phase:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.11);
}

.phase h3 {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 7px;

    color: #2c3e50;
    font-size: 1.15rem;
}

.duration {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 7px;

    color: #e74c3c;
    font-size: 0.95rem;
    font-weight: 600;
}

.phase p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================
   LINHA DO TEMPO
========================= */

.timeline-events {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.event {
    display: flex;
    align-items: flex-start;

    margin-bottom: 0; /* Reset margin since we're using grid gap */
    padding: 18px;

    background: white;
    border-left: 4px solid #3498db;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.event.completed {
    background-color: #e8f4e8;
    border-left-color: #27ae60;
}

.event.completed .date {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    position: relative;
}

.event.completed .date::before {
    content: "\f00c"; /* Font Awesome check icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -8px;
    right: -8px;
    background: #2ecc71;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.event.upcoming {
    border-left: 4px solid #3498db;
    position: relative;
}

.event.upcoming .date {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.remaining-days {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    width: fit-content;
}

.event:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.11);
}

.event:nth-child(3) {
    border-left-color: #2ecc71;
}

.event:nth-child(4) {
    border-left-color: #e74c3c;
}

.event:nth-child(5) {
    border-left-color: #9b59b6;
}

.event:nth-child(6) {
    border-left-color: #f39c12;
}

.date {
    flex: 0 0 130px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    margin-right: 18px;
    padding: 10px;

    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 7px;

    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.event.completed:nth-child(3) .date {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.event.completed:nth-child(4) .date {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.event.completed:nth-child(5) .date {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.event.completed:nth-child(6) .date {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.event.upcoming:nth-child(1) .date {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.event.upcoming:nth-child(2) .date {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.event.upcoming:nth-child(3) .date {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.event.upcoming:nth-child(4) .date {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.event.upcoming:nth-child(5) .date {
    background: linear-gradient(135deg, #e7449c 0%, #c0392b 100%);
}

.content {
    flex: 1;
}

.content h3 {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 6px;

    color: #2c3e50;
    font-size: 1.1rem;
}

.content p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================
   FOOTER
========================= */

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--footer-height);
    z-index: 1000;

    display: flex;
    align-items: center;

    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
}

footer p {
    font-size: 0.85rem;
}

/* =========================
   TABLET
========================= */

@media (max-width: 992px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .timeline-events {
        grid-template-columns: repeat(2, 1fr); /* Keep 2 columns on tablets */
    }
}

/* =========================
   TELEMÓVEL
========================= */

@media (max-width: 768px) {
    :root {
        --header-height: 62px;
        --tabs-height: 54px;
        --footer-height: 44px;
    }

    header h1 {
        font-size: 1.15rem;
    }

    header h1 i {
        font-size: 1.1rem;
    }

    .tab-button {
        flex-direction: column;
        gap: 2px;
        padding: 4px 3px;
        font-size: 0.68rem;
        line-height: 1.1;
    }

    .tab-button i {
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 20px 0 28px;
    }

    h2 {
        margin-bottom: 18px;
        font-size: 1.25rem;
    }

    .timeline-events {
        grid-template-columns: 1fr; /* Change to single column on mobile */
    }

    .event {
        flex-direction: column;
        padding: 15px;
    }

    .date {
        flex: initial;
        width: 100%;
        margin: 0 0 12px;
        flex-direction: row;
    }
}

/* =========================
   ECRÃS PEQUENOS
========================= */

@media (max-width: 520px) {
    .container {
        padding: 0 12px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .overview-card {
        min-height: 145px;
        padding: 16px 12px;
    }

    .icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .phase,
    .event {
        padding: 14px;
    }

    footer p {
        font-size: 0.75rem;
    }
}