
/* Dark Theme */
body.theme-dark {
  --background: #0f0b1f;
  --foreground: #f5f6fa;
  --accent: #B33791;
  --accent-dark: #B33791;
  --card-bg: #1F1D36;
  --border: #262342;
  --success: #27c93f;
  --danger: #ff5f56;
  --warning: #ffbd2e;
  --input-bg: #23272e;
  --input-border: #333;
  --input-text: #FF0000;
  --table-header: #23272e;
  --table-row: #181a1b;
  --table-row-alt: #23272e;
  --shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* General background and text */
body.theme-dark {
  background: var(--background);
  color: var(--foreground);
}

body.theme-dark .site-footer h2,
body.theme-dark .site-footer h3,
body.theme-dark .site-footer a:hover{
    color: var(--foreground);
}

body.theme-dark .site-footer {
    background: var(--card-bg) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow);
}

/* Profile Page */
body.theme-dark .profile-title,
body.theme-dark .profile-container, 
body.theme-dark .profile-container > p{
    color: #fff;
}

body.theme-dark .challenge-title {
    color: var(--foreground);
}

/* Solution */
body.theme-dark .solution code {
    background-color: var(--border);
    border: none;
}

body.theme-dark .solution,
body.theme-dark .solution-tete {
  background-color: var(--card-bg);
  border-color: var(--border);
}

body.theme-dark svg path{
  fill: var(--foreground);
}

body.theme-dark .back-to-chall {
  color: var(--foreground);
}

body.theme-dark .back-to-chall img {
  filter: invert(100%);
}

/* Top notification */
body.theme-dark .top-notification {
  background-color: var(--card-bg);
  border-color: var(--border);
  color: var(--foreground);
}

/* Challenge page */
body.theme-dark .dropdown-content-filter strong{
    color : var(--foreground);
}

body.theme-dark .dropdown-content-filter {background-color: var(--input-bg); border-color: var(--input-border);}
body.theme-dark .dropdown-content-filter a {color: var(--foreground);}

body.theme-dark .dropdown-content-sort {background-color: var(--input-bg); border-color: var(--input-border);}
body.theme-dark .dropdown-content-sort a {color: var(--foreground);}

body.theme-dark .dropdown-button{
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--foreground);
}

body.theme-dark .code-container pre {
  margin: 0;
  padding: 0;
  background-color: var(--card-bg);
  font-size: 15px;    /* Adjust font size here */
  line-height: 1.5;
  font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', monospace;
  overflow-x: auto;
}

/* Cards, containers, nav, footer */
body.theme-dark .challenge-card,
body.theme-dark .how-card,
body.theme-dark .question-card,
body.theme-dark .references,
body.theme-dark .login-form,
body.theme-dark .register-form,
body.theme-dark .code-container-hover-index{
  background: var(--card-bg);
  color: var(--foreground);
  border: solid 1px var(--border);
  box-shadow: var(--shadow);
}

body.theme-dark .completed-challenge{
  background-color: rgb(128, 241, 145);
}
body.theme-dark .completed-challenge .challenge-title,
body.theme-dark .completed-challenge {
  color: #2b2d42;
}

body.theme-dark .code-line:hover {
  background: var(--table-row);
}

body.theme-dark .how-card:hover {border: solid 1px var(--accent);}

body.theme-dark nav a:hover,
body.theme-dark nav button.logout-link:hover {
  color: var(--accent);
}

body.theme-dark .user-menu-dropdown {
  background-color: var(--card-bg);
  border: solid 1px var(--border);
  box-shadow: var(--shadow);
}

body.theme-dark .dropdown-item p {
  color: var(--foreground);
}

body.theme-dark .dropdown-item img {
  background-color: var(--foreground);
}

body.theme-dark .dropdown-item:hover {
  background-color: #312f49;
}

/* band */

body.theme-dark .band-track a {
  color: white;
}

/* test */
body.theme-dark .sponsor-challenge-card {
    background: none;
    border: 1px solid #E4E6E7;
    padding: 10px;
    border-radius: 5px;

    min-height: 120px;
    /* height: fit-content; */

    flex-direction: column;
    justify-content: space-between;

    flex: 0 0 calc((100% - 14px) / 3);
    box-sizing: border-box;

    word-break: break-word;
    overflow-wrap: break-word;
    color: #000000;
    background-image: linear-gradient(180deg, #f6e27a 20%, #cb9b51 80%);

    font-weight: bold;

    border-width: 0;
    display: flex;
  
    /* box-shadow: 0 4px 12px 0 #ffcd57; */
    transition: all 0.5s ease;
  
    position: relative;
    overflow: hidden;
}

/* Navbar */
body.theme-dark nav a::after, nav button.logout-link::after {
  background-color: var(--accent);
}

body.theme-dark nav {
  color: var(--foreground);
}
body.theme-dark .header {
  color: var(--foreground);
}

body.theme-dark nav a,
body.theme-dark nav button.logout-link {
  color: var(--foreground);
}

body.theme-dark nav a.active,
body.theme-dark nav button.logout-link.active {
  /* background: var(--accent); */
  color: var(--accent);
}

/* Mini challenge */

.code-container-hover-index button {color: var(--foreground);}

/* Buttons */
body.theme-dark .send_btn,
body.theme-dark .change_btn,
body.theme-dark .hint-toggle {
  background: var(--accent);
  color: #fff;
}

body.theme-dark .hint-container details {background-color: var(--input-bg); border-color: var(--input-border);}
body.theme-dark .hint-container details summary {color: var(--foreground);}

body.theme-dark .send_btn:hover,
body.theme-dark .change_btn:hover,
body.theme-dark .hint-toggle:hover {
  background: var(--accent-dark);
}

/* header */

body.theme-dark .text-container button {
  background: var(--foreground);
  color: var(--border);
}

body.theme-dark .text-container .subtitle {
  color: var(--foreground);
}

body.theme-dark .text-container .getting-started {
  color: var(--background);
  background-color: var(--foreground);
}

/* ToolTip */
body.theme-dark .tooltip-typed-text {
  color: #fff;
}

/* Hint */
body.theme-dark summary {
  color: var(--background);
}

/* Inputs */
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .form-control {
  background: var(--input-bg);
  color: var(--foreground);
  border-color: var(--input-border);
}

body.theme-dark input.correct{
  background-color: #223322;
}

body.theme-dark input {
  color: var(--foreground);
}

body.theme-dark #searchInput {
  color: var(--foreground);
}

body.theme-dark #theme-toggle {
  border-radius: 50%;
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus,
body.theme-dark .form-control:focus {
  border-color: var(--accent);
}


body.theme-dark .incorrect {
  background-color: #331a1a;
}

/* Progress bar */
body.theme-dark .progress-bar-container {
  background: #222;
}
body.theme-dark .progress-bar {
  background: linear-gradient(90deg, var(--accent) 60%, var(--accent-dark) 100%);
}

/* Tables */
body.theme-dark .leaderboard-table th {
  background: var(--table-header);
  color: var(--foreground);
}
body.theme-dark .leaderboard-table td {
  background: var(--table-row);
  color: var(--foreground);
}
body.theme-dark .leaderboard-table tr:nth-child(even) td {
  background: var(--table-row-alt);
}

body.theme-dark .leaderboard-card {
  background-color: var(--card-bg);
  border-color: var(--border);
}

body.theme-dark .leaderboard-card .username {
  color: var(--foreground);
}

body.theme-dark .leaderboard-card .completed {
  color: rgb(126, 126, 126);
}

/* Code editor */
body.theme-dark .code-editor-bar,
body.theme-dark .code-container,
body.theme-dark .code-container-index,
body.theme-dark .code-editor-index,
body.theme-dark .bar-index {
  background: var(--card-bg) !important;
  color: var(--foreground) !important;
  border-color: var(--border) !important;
}

/* PrismJS code blocks (override theme if needed)
body.theme-dark pre[class*="language-"],
body.theme-dark code[class*="language-"] {
  background: #181a1b !important;
  color: #f5f6fa !important;
}
*/

/* Misc */
body.theme-dark .completed-message {
  background: #223322;
  color: #b6ffb6;
}
body.theme-dark .empty-message {
  color: #aaa;
}

body.theme-dark .profile-container li {
  background-color: var(--card-bg);
  border-color: var(--border);
}

body.theme-dark .profile-container .list-title {
  color: var(--foreground);
}

body.theme-dark .profile-container .band {
  border-color: var(--border);
}

body.theme-dark .profile-container .name-container p {
  color: var(--foreground);
} 


body.theme-dark .profile-container .profile-section {
  background-color: var(--card-bg);
  border-color: var(--border);
}

body.theme-dark .profile-container .delete-account-section {
  background-color: var(--card-bg);
  border-color: var(--border);
}

body.theme-dark .profile-container .modal {
  background-color: var(--card-bg);
  color: var(--foreground);
}

body.theme-dark .profile-container .modal-header h2 {
  color: var(--foreground);
}

body.theme-dark .profile-container .modal-header p  {
  color: var(--foreground);
}

body.theme-dark .profile-container .modal-body p {
  color: var(--foreground);
}

body.theme-dark .alert-success { background: #223322; color: #27c93f; }
body.theme-dark .alert-error, body.theme-dark .alert-danger { background: #331a1a; color: #ff5f56; }
body.theme-dark .alert-info { background: #1a2233; color: #007EC6; }
body.theme-dark .alert-warning { background: #332a1a; color: #ffbd2e; }


/* Community */
body.theme-dark .support-container {background-color: transparent; border: solid 1px var(--border);}
body.theme-dark .support-container:hover {background-color: transparent; border: solid 1px var(--accent);}
body.theme-dark .support-container h3 {color: var(--foreground);}