/* ===== Formation Page ===== */

.formation-main {
    padding-top: 9vh;
}

/* Page Hero */
.page-hero {
    padding: 4vh 4vh 2vh 4vh;
    text-align: center;
}

.page-hero h1 {
    font-size: 5vh;
    font-weight: 800;
    color: rgba(10,10,10,0.88);
    margin: 0 0 1vh 0;
}

.page-hero h1 span {
    color: #164fb8;
}

.page-hero p {
    font-size: 2.2vh;
    color: rgba(0,0,0,0.55);
    margin: 0;
}

/* Timeline */
.timeline-section {
    padding: 2vh 4vh 4vh 4vh;
}

.timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #164fb8, rgba(22,79,184,0.15));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 2.5vh;
}

.timeline-dot {
    position: absolute;
    left: 10px;
    top: 28px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid #164fb8;
    box-sizing: border-box;
    transition: background 0.3s;
    z-index: 1;
}

.timeline-item.active .timeline-dot {
    background: #164fb8;
    box-shadow: 0 0 0 5px rgba(22,79,184,0.18);
}

/* Timeline card */
.timeline-card {
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover {
    box-shadow: 0 14px 45px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.timeline-card-header {
    padding: 2.2vh 2.5vh;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4vh;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 1vh;
}

.timeline-year {
    font-size: 1.7vh;
    font-weight: 700;
    color: #164fb8;
    font-family: monospace;
}

.timeline-badge {
    padding: 0.3vh 1.2vh;
    border-radius: 999px;
    font-size: 1.4vh;
    font-weight: 700;
}

.timeline-badge.current {
    background: rgba(22,79,184,0.12);
    color: #164fb8;
}

.timeline-badge.done-badge {
    background: rgba(34,170,85,0.12);
    color: #18a855;
}

.timeline-card-header h2 {
    margin: 0;
    font-size: 2.6vh;
    font-weight: 800;
    color: rgba(10,10,10,0.88);
}

.timeline-card-header h3 {
    margin: 0;
    font-size: 1.9vh;
    font-weight: 600;
    color: rgba(0,0,0,0.5);
}

.toggle-icon {
    position: absolute;
    right: 2.5vh;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8vh;
    color: #164fb8;
    transition: transform 0.3s ease;
    user-select: none;
}

.timeline-card.open .toggle-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Card body - collapsed by default except first */
.timeline-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    padding: 0 2.5vh;
}

.timeline-card-body p {
    font-size: 2vh;
    color: rgba(0,0,0,0.7);
    line-height: 1.6;
    margin: 0 0 2vh 0;
}

/* Open state */
.timeline-card.open .timeline-card-body {
    max-height: 800px;
    padding: 0 2.5vh 2.5vh 2.5vh;
}

/* First card open by default */
.timeline-item.active .timeline-card .timeline-card-body {
    max-height: 800px;
    padding: 0 2.5vh 2.5vh 2.5vh;
}

/* Semestres */
.semestres h4, .matieres h4 {
    font-size: 1.8vh;
    font-weight: 700;
    color: rgba(10,10,10,0.7);
    margin: 0 0 1.2vh 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.semestre-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8vh;
    margin-bottom: 2vh;
}

.semestre {
    display: grid;
    grid-template-columns: 40px 1fr 100px 40px;
    align-items: center;
    gap: 1.2vh;
}

.sem-fraction {
    font-size: 1.5vh;
    font-weight: 700;
    color: #164fb8;
    font-family: monospace;
    text-align: right;
}

.sem-label {
    font-size: 1.6vh;
    font-weight: 800;
    color: #164fb8;
    font-family: monospace;
}

.sem-title {
    font-size: 1.7vh;
    color: rgba(0,0,0,0.7);
}

.sem-bar {
    height: 6px;
    background: rgba(22,79,184,0.1);
    border-radius: 999px;
    overflow: hidden;
}

.sem-fill {
    height: 100%;
    background: #164fb8;
    border-radius: 999px;
    transition: width 1s ease;
}

.semestre.active-sem .sem-fill {
    background: linear-gradient(90deg, #164fb8, #5b8bdb);
}

.semestre.upcoming .sem-label,
.semestre.upcoming .sem-title {
    opacity: 0.4;
}

/* Matières chips */
.matieres-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8vh;
}

.matiere-chip {
    padding: 0.6vh 1.4vh;
    background: rgba(22,79,184,0.08);
    border: 1px solid rgba(22,79,184,0.18);
    border-radius: 999px;
    font-size: 1.6vh;
    color: #164fb8;
    font-weight: 600;
}

.matiere-chip.highlight {
    background: #164fb8;
    color: white;
    border-color: #164fb8;
}

/* BUT GEII Competences section */
.competences-but-section {
    padding: 0 4vh 5vh 4vh;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.competences-but-section h2 {
    font-size: 3vh;
    font-weight: 800;
    color: rgba(10,10,10,0.85);
    margin: 0 0 2.5vh 0;
    text-align: center;
}

.competences-but-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8vh;
}

.comp-but-card {
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    padding: 2vh;
    display: flex;
    gap: 1.5vh;
    align-items: flex-start;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.comp-but-card:hover,
.comp-but-card.highlighted {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(22,79,184,0.16);
    border-color: rgba(22,79,184,0.35);
}

.comp-but-num {
    font-size: 2.2vh;
    font-weight: 900;
    color: white;
    background: #164fb8;
    border-radius: 10px;
    width: 5vh;
    height: 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: monospace;
}

.comp-but-info h3 {
    margin: 0 0 0.5vh 0;
    font-size: 2vh;
    font-weight: 800;
    color: rgba(10,10,10,0.85);
}

.comp-but-info p {
    margin: 0;
    font-size: 1.6vh;
    color: rgba(0,0,0,0.6);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 700px) {
    .timeline-section,
    .competences-but-section {
        padding: 2vh 2vh 4vh 2vh;
    }

    .timeline::before { left: 14px; }
    .timeline-item { padding-left: 44px; }
    .timeline-dot { left: 4px; }

    .semestre { grid-template-columns: 32px 1fr 80px; }

    .competences-but-grid {
        grid-template-columns: 1fr;
    }
}
