body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #ffffff;
    color: #333333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #222222;
    color: #ffffff;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 7px;
}

label {
    width: 100%;
    cursor: pointer;
}

.subtitle {
    text-align: center;
    font-size: 14px;
    color: inherit;
    margin-bottom: 10px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
}

.subtitle a {
    color: inherit;
}

.options {
    display: flex;
    gap: 10px;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.toggle-label {
    margin-right: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #444444;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

#spinner {
    display: none;
    border: 4px solid #ccc;
    border-left-color: #333;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    animation: spin 5s linear infinite;
    margin-left: 10px;
}

body.dark-mode #spinner {
    border: 4px solid #444444;
    border-left-color: white;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

#weekly-contests,
#biweekly-contests {
    width: 48%;
}

@media (max-width: 768px) {

    #weekly-contests,
    #biweekly-contests {
        width: 100%;
    }
}

.contest-dropdown {
    margin-bottom: 10px;
    background-color: inherit;
}

.contest-dropdown>summary {
    background-color: #f2f2f2;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
    transition: background-color 0.3s;
    border-radius: 7px;
}

body.dark-mode .contest-dropdown>summary {
    background-color: #444444;
}

.contest-dropdown[open]>summary a {
    text-decoration: none;
    color: inherit;
}

.contest-dropdown[open]>summary a:hover {
    text-decoration: underline;
}

.solved-problems {
    color: #666666;
    margin-left: 10px;
}

body.dark-mode .solved-problems {
    color: #b6b6b6;
}

.placeholder-text {
    background-color: #f2f2f2;
    padding: 10px;
    font-weight: bold;
    color: inherit;
    transition: background-color 0.3s;
}

body.dark-mode .placeholder-text {
    background-color: #444444;
}

.problem-checkbox {
    margin-left: 20px;
    display: flex;
    align-items: center;
    color: inherit;
}

.problem-link {
    text-decoration: none;
    color: inherit;
}

.problem-link:hover {
    text-decoration: underline;
}

.problem-rating {
    margin-left: 10px;
    font-size: 0.9em;
    color: #666;
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 5px;
    transition: transform 0.3s;
}

.contest-dropdown[open] .dropdown-arrow {
    transform: rotate(180deg);
}

.contest-dropdown.all-checked>summary {
    background-color: #4CAF50;
    color: #fff;
    text-decoration: line-through;
}

body.dark-mode .contest-dropdown.all-checked>summary {
    background-color: #2E7D32;
    color: #fff;
    text-decoration: line-through;
}

.refresh-icon {
    display: none;
    cursor: pointer;
    margin-left: 10px;
    fill: #666;
}

.toggle-container input[type="checkbox"]:checked+.slider+.refresh-icon {
    display: block;
}

.refresh-icon:hover {
    fill: #333;
}