/* Background utama dan warna teks default */
body {
    background-color: #230b3a !important;
    color: #ffffff !important;
}

/* Memaksa Navbar atas menjadi ungu tua */
nav.navbar,
.navbar.navbar-expand-md,
.navbar-light,
.bg-light {
    background-color: #150422 !important;
    border-color: #150422 !important;
}

nav.navbar a,
nav.navbar span,
nav.navbar div,
.navbar-light .navbar-brand,
.navbar-light .navbar-nav .nav-link {
    color: #ffffff !important;
}

/* Kartu dan Kotak Konten Utama */
.card,
.jumbotron,
.well {
    background-color: #2f104d !important;
    color: #ffffff !important;
    border-color: #5c2091 !important;
}

/* MENGUBAH JUDUL PANEL (SUBMISSIONS, CLARIFICATIONS) MENJADI UNGU TUA */
h1.teamoverview {
    background-color: #1a062c !important;
    color: #ffffff !important;
    padding: 10px 15px !important;
    border-radius: 4px;
    border: 1px solid #5c2091 !important;
}

/* SCOREBOARD BESAR & FULL WIDTH (MENUTUP RUANG KOSONG DI KANAN) */
table.scoreboard,
.scoreboard,
.scoreboard_table {
    font-size: 1.2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
}

.container,
.container-fluid,
.col-12 {
    max-width: 100% !important;
}

/* HEADER SCOREBOARD AGAR BERSIH DAN MENUTUP PENUH TANPA SISA PUTIH */
tr.scoreheader,
.scoreheader th {
    background: #1a062c !important;
    background-image: none !important;
    background-color: #1a062c !important;
    color: #ffffff !important;
    border-color: #5c2091 !important;
}

table.scoreboard td,
table.scoreboard th,
.scoreboard td,
.scoreboard th,
.table th,
.table td,
.table thead th {
    background-color: #2f104d !important;
    color: #ffffff !important;
    padding: 14px 18px !important;
    border: 1px solid #7b2cbf !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #351356 !important;
}

/* Make verdict colors fill the complete scoreboard problem cell. */
.scoreboard tbody td:not(.score_cell) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.scoreboard td.score_cell {
    padding: 0 !important;
}

.scoreboard td.score_cell > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.scoreboard td.score_cell > a > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
}

/* MENGEMBALIKAN POSISI LENCANA PROBLEM (A, B, C) KE TENGAH */
.problem-badge,
span[class="badge"],
.badge,
th.scoreheader {
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* KOTAK CELL COLOURS AGAR WARNA-WARNI & FULL WIDTH */
table.table-sm,
table.table-bordered,
.col-md-3,
div:has(> table) {
    width: 100% !important;
}

td.score_solved,
td.score_first,
td.score_incorrect,
td.score_pending,
td.score_untried,
tr.score_solved,
tr.score_first,
tr.score_incorrect,
tr.score_pending,
tr.score_untried {
    color: #ffffff !important;
}

.legend_sol,
td.score_correct {
    background: #4cd964 !important;
    color: #ffffff !important;
}

.legend_first,
td.score_correct.score_first {
    background: #1a9336 !important;
    color: #ffffff !important;
}

.legend_incorrect,
td.score_incorrect {
    background: #e06b6b !important;
    color: #ffffff !important;
}

.legend_pending,
td.score_pending {
    background: #6574f5 !important;
    color: #ffffff !important;
}

.legend_untried,
td.score_untried {
    background: #2f104d !important;
    color: #ffffff !important;
}

/* Keep DOMjudge verdict colors visible despite the global white-text rules. */
.sol.sol_correct,
.compile-successful {
    color: #4cd964 !important;
}

.sol.sol_incorrect,
.compile-unsuccessful {
    color: #ff6b6b !important;
}

.sol.sol_queued {
    color: #c8b4d8 !important;
}

/* Teks umum agar tetap putih bersih */
h1:not(.teamoverview),
h2,
h3,
h4,
h5,
h6,
p,
.text-muted {
    color: #ffffff !important;
}

/* Menimpa border silver dan box-shadow bawaan DOMjudge pada scoreboard */
.scoreboard td,
.scoreboard th,
table.scoreboard td,
table.scoreboard th {
    border-right: 1px solid #7b2cbf !important;
    border-left: 1px solid #7b2cbf !important;
    border-top: 1px solid #7b2cbf !important;
    border-bottom: 1px solid #7b2cbf !important;
    box-shadow: none !important;
}

/* Memaksa semua garis border tabel, tr, th, dan td menjadi ungu muda */
table,
.table,
.scoreboard,
.scoreboard td,
.scoreboard th,
table.scoreboard td,
table.scoreboard th,
.data-table tr,
.data-table td,
.data-table th {
    border-color: #7b2cbf !important;
}

/* Menghilangkan bayangan hitam (box-shadow) yang membuat garis tampak gelap */
th.scoreheader,
td,
th {
    box-shadow: none !important;
}

/* Memaksa garis atas, bawah, kiri, dan kanan seluruh tabel dan baris menjadi ungu muda */
table,
.table,
.scoreboard,
.scoreboard tr,
.scoreboard td,
.scoreboard th,
table.scoreboard tr,
table.scoreboard td,
table.scoreboard th,
.data-table,
.data-table tr,
.data-table td,
.data-table th,
thead,
tbody,
tr {
    border-top-color: #7b2cbf !important;
    border-bottom-color: #7b2cbf !important;
    border-left-color: #7b2cbf !important;
    border-right-color: #7b2cbf !important;
}

/* Mematikan garis pembatas bawaan yang sering berwarna hitam di baris tabel */
.data-table tr,
table tr {
    border-bottom: 1px solid #7b2cbf !important;
    border-top: 1px solid #7b2cbf !important;
}

/* === PENGATURAN AKHIR CELL COLOURS SESUAI GAMBAR REFERENSI DENGAN TEKS PUTIH === */

table#cell_legend,
.scorelegend {
    background: #2f104d !important;
}

table#cell_legend td,
table#cell_legend th,
.scorelegend td,
.scorelegend th {
    border: 1px solid #7b2cbf !important;
}

/* 1. Solved first (Hijau solid sesuai referensi) */
table#cell_legend tr.score_correct.score_first td,
.scorelegend tr.score_correct.score_first td,
td.score_correct.score_first {
    background: #1a9336 !important;
    color: #ffffff !important;
}

/* 2. Solved (Hijau muda cerah sesuai referensi - dipisah mutlak dari score_first) */
table#cell_legend tr.score_correct td,
.scorelegend tr.score_correct td,
td.score_correct {
    background: #4cd964 !important;
    color: #ffffff !important;
}

/* 3. Tried, incorrect (Merah salmon sesuai referensi) */
table#cell_legend tr.score_incorrect td,
.scorelegend tr.score_incorrect td,
td.score_incorrect {
    background: #e06b6b !important;
    color: #ffffff !important;
}

/* 4. Tried, pending (Biru periwinkle sesuai referensi) */
table#cell_legend tr.score_pending td,
.scorelegend tr.score_pending td,
td.score_pending {
    background: #6574f5 !important;
    color: #ffffff !important;
}

/* 5. Untried & Judul Cell colours: Tetap Ungu sesuai tema */
table#cell_legend tr.score_neutral td,
.scorelegend tr.score_neutral td,
td.score_untried {
    background: #2f104d !important;
    color: #ffffff !important;
}

/* Memastikan seluruh teks di dalam sel tabel legenda mutlak berwarna putih */
table#cell_legend td,
.scorelegend td,
table#cell_legend th,
.scorelegend th {
    color: #ffffff !important;
}

/* Form controls use the same dark-purple surface as the rest of the theme. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select,
textarea,
.form-control,
.form-select,
.select2-container .select2-selection,
.select2-selection--multiple,
.select2-container--default .select2-selection,
.select2-container--bootstrap .select2-selection,
.select2-container--bootstrap4 .select2-selection,
.select2-container--bootstrap5 .select2-selection,
.select2-container--default .select2-search__field {
    background-color: #2f104d !important;
    border-color: #7b2cbf !important;
    color: #ffffff !important;
}

.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    background-color: #2f104d !important;
    border-color: #7b2cbf !important;
    color: #ffffff !important;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

input::placeholder,
textarea::placeholder,
.select2-search__field::placeholder {
    color: #d8b9f0 !important;
    opacity: 1 !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #d8b9f0 !important;
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
    color: #d8b9f0 !important;
}

select option {
    background-color: #2f104d !important;
    color: #ffffff !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #5c2091 !important;
    border-color: #7b2cbf !important;
    color: #ffffff !important;
}

.select2-container .select2-selection__rendered,
.select2-container .select2-selection__placeholder,
.select2-container .select2-search--inline .select2-search__field,
.select2-container .select2-selection__choice__remove {
    background-color: transparent !important;
    color: #ffffff !important;
}

.select2-container .select2-selection__choice {
    background-color: #5c2091 !important;
    border-color: #7b2cbf !important;
    color: #ffffff !important;
}

.select2-dropdown {
    background-color: #2f104d !important;
    border-color: #7b2cbf !important;
}

.select2-container--default .select2-results__option {
    background-color: #2f104d !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #5c2091 !important;
    color: #ffffff !important;
}

.select2-container .select2-results__option {
    background-color: #2f104d !important;
    color: #ffffff !important;
}

.select2-container .select2-results__option--highlighted {
    background-color: #5c2091 !important;
    color: #ffffff !important;
}

/* === PAKSA SEMUA TEKS TERSISA (DI JURY/SCOREBOARD) MENJADI PUTIH BERSIH === */
.card-body *,
.card-header *,
table *,
td *,
th *,
span:not(.badge),
a:not(.btn),
li,
ul,
label,
small,
.text-dark,
.text-muted {
    color: #ffffff !important;
}

a:hover,
a:focus {
    color: #e0b0ff !important;
}

/* === MENGUBAH BACKGROUND FILTER "SHOW:" DAN TOMBOLNYA MENJADI UNGU === */
.input-group-text.listtoggles,
.input-group-text,
.btn-group .btn,
.btn-outline-secondary,
.btn-secondary {
    background-color: #2f104d !important;
    border-color: #5c2091 !important;
    color: #ffffff !important;
}

/* Tombol filter saat aktif/disorot */
.btn-group .btn-check:checked+.btn,
.btn-group .btn.active,
.btn-group .btn:hover,
.btn-outline-secondary:hover {
    background-color: #5c2091 !important;
    border-color: #7b2cbf !important;
    color: #ffffff !important;
}

/* === MENGUBAH BACKGROUND DROPDOWN MENU / POPUP MENJADI UNGU === */
.dropdown-menu,
.popover,
.dropdown-content {
    background-color: #2f104d !important;
    border: 1px solid #5c2091 !important;
    color: #ffffff !important;
}

/* Memastikan setiap item link di dalam dropdown menu berwarna putih dan tidak silau saat disorot */
.dropdown-menu .dropdown-item,
.dropdown-menu a {
    color: #ffffff !important;
    background-color: transparent !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu a:hover {
    background-color: #5c2091 !important;
    color: #ffffff !important;
}

/* Memastikan teks atau angka di dalam badge/bulatan indikator tampil jelas */
.dropdown-menu .badge,
.navbar .badge {
    color: #ffffff !important;
}

/* Replace the DOMjudge wordmark with the Recursion navbar mark. */
.navbar .navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    width: 42px !important;
    height: 42px !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle !important;
}

.navbar .navbar-brand::before {
    content: "";
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 36px;
    background: url("/images/custom/recursion-navbar.webp") center / contain no-repeat;
}

/* === MENAMPILKAN BANNER RECURSION 2.0 TEPAT DI ATAS SCOREBOARD (FINAL) === */
div.mt-3:has(table.scoreboard):before {
    content: "";
    display: block;
    width: 100%;
    /* height: 450px; */
    height: 200px;
    /* height: 165px; */
    background-image: url('/images/custom/banner-1.png') !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 20px;
}

/* Mengembalikan ikon FontAwesome / medali agar tidak hilang */
table td i,
table th i,
.scoreboard i,
.scoreboard span.fa,
td span[class*="fa-"] {
    color: inherit !important;
    display: inline-block !important;
}

/* Submission output panels (diff, stdout, stderr, and judging logs). */
.output_text {
    background: #2f104d !important;
    background-color: #2f104d !important;
    border: 1px solid #7b2cbf !important;
    color: #ffffff !important;
}

/* Monaco source editor surfaces used on executable and source pages. */
.monaco-editor,
.monaco-editor .overflow-guard,
.monaco-editor .monaco-editor-background,
.monaco-editor .margin,
.monaco-editor .glyph-margin {
    background-color: #2f104d !important;
}

.monaco-editor .view-line span {
    color: #ffffff !important;
}

.monaco-editor .cursor,
.monaco-editor .cursors-layer {
    color: #ffffff !important;
}