/* Style untuk Halaman Class Meeting */
.cm-header {
    background: linear-gradient(135deg, #107C41, #0d6334);
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}
.cm-header h1 {
    margin: 0;
    font-size: 2.5em;
}

.cm-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.cm-section h2 {
    margin-top: 0;
    color: #107C41;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 10px;
}

/* Tabel Klasemen & Papan Peringkat */
.standings-table, .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
.standings-table th, .standings-table td,
.leaderboard-table th, .leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}
.standings-table thead th, .leaderboard-table thead th {
    background-color: #f9f9f9;
    font-weight: 600;
}
.standings-table tbody tr:nth-child(odd),
.leaderboard-table tbody tr:nth-child(odd) {
    background-color: #fcfcfc;
}
.standings-table tbody tr:hover,
.leaderboard-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Grid Lomba */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.event-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border-left: 4px solid #107C41;
}
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left-color: #48D1CC;
}
.event-card h3 { margin: 0 0 10px 0; }
.event-card .tag { display: inline-block; font-size: 0.8em; padding: 3px 10px; border-radius: 12px; font-weight: 600; margin-right: 5px; }
.event-card .tag.gugur { background-color: #e0e7ff; color: #4338ca; }
.event-card .tag.peringkat { background-color: #d1fae5; color: #065f46; }
.event-card .tag.kelas { background-color: #fef3c7; color: #92400e; }
.event-card .tag.guru { background-color: #fee2e2; color: #991b1b; }

/* === STYLE BARU UNTUK HALAMAN DETAIL LOMBA === */
.cm-event-header {
    text-align: center;
    margin-bottom: 30px;
}
.cm-event-header h1 {
    margin-bottom: 10px;
}

.participant-list-public {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.participant-list-public li {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 5px;
}

/* === BAGAN PERTANDINGAN BARU === */
.bracket-container {
    overflow-x: auto; /* Agar bisa di-scroll di HP */
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}
.bracket {
    display: flex;
    min-width: 800px; /* Lebar minimal agar tidak terlalu sempit */
}
.bracket .round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-grow: 1;
    list-style: none;
    padding: 0;
}
.bracket .round:first-child .match {
    margin-bottom: 20px;
}
.bracket .match {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}
/* Garis penghubung horizontal */
.bracket .match::after {
    content: '';
    position: absolute;
    right: -22px;
    top: 50%;
    width: 22px;
    height: 2px;
    background: #ccc;
}
.bracket .round:last-child .match::after {
    display: none; /* Hilangkan garis di ronde terakhir */
}
/* Garis penghubung vertikal */
.bracket li.match:nth-child(odd)::before {
    content: '';
    position: absolute;
    right: -22px;
    top: 50%;
    width: 2px;
    height: calc(100% + 20px); /* Tinggi garis vertikal */
    background: #ccc;
}
.bracket .team {
    display: flex;
    justify-content: space-between;
    padding: 5px;
}
.bracket .team.winner {
    font-weight: bold;
    color: #107C41;
}
.bracket .team span {
    font-weight: bold;
}
.bracket .champion .match {
    background-color: #ffd700;
    border-color: #e6c200;
    text-align: center;
    font-weight: bold;
}
.bracket .champion .champion-name {
    font-size: 1.2em;
}
