* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 20px;
}

.sidebar {
    background: #1f2937;
    color: white;
    padding: 30px;
}

.sidebar h1 {
    margin-top: 0;
}

.tagline {
    color: #cbd5e1;
    margin-bottom: 30px;
}

.feature-box {
    background: #374151;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.feature-box ul {
    padding-left: 20px;
}

.challenge-panel {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
}

.challenge-card {
    width: 100%;
    max-width: 900px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -30px -30px 20px -30px;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: bold;
    border-radius: 16px 16px 0 0;
}

.theme-toggle {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-toggle span {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
}

.theme-toggle span:hover {
    transform: scale(1.1);
} 

.difficulty.easy {
    color: #16a34a;
}

.difficulty.medium {
    color: #d97706;
}

.difficulty.hard {
    color: #dc2626;
}

pre {
    background: #111827;
    color: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    font-size: 15px;
    overflow-x: auto;
}

.question {
    margin: 25px 0;
    font-size: 18px;
    font-weight: bold;
}

.option {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
}

.option:hover {
    background: #f3f4f6;
}

button {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.8;
}

.result-header {
    margin: -25px -25px 20px -25px;
    padding: 18px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    font-weight: bold;
}

.result-header.correct {
    background: #dcfce7;
    color: #166534;
}

.result-header.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

form {
    display: flex;
    flex-direction: column;
}

#feedback-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);

    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none;
}

.modal-content {
    width: 500px;
    background: white;
    padding: 25px;
    border-radius: 12px;
}

#feedback-text {
    width: 100%;
    height: 120px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* challenge statistics code */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.stat-value {
    margin-top: 6px;
    font-size: 24px;
    font-weight: bold;
    color: #111827;
}

/* share button code */
.share-action {
    margin-top: 12px;
    text-align: center;
    color: #6b7280;
    cursor: pointer;
}

.share-action:hover {
    color: #111827;
}

/*mobile responsive code */
@media (max-width: 768px) {

    .wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        margin-top: 20px;
    }

    .challenge-panel {
        padding: 20px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .challenge-card {
        padding: 20px;
    }

    .modal-content {
        width: 90%;
    }
}

/* footer code */
.footer {
    background: #eef2f7;
    border-top: 1px solid #dbe2ea;
    padding: 8px 0;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* dark mode light mode settings code */
body.dark-mode {
    background: #111827;
    color: #f9fafb;
}

body.dark-mode .challenge-card {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode .top-row {
    border-bottom: 1px solid #374151;
}

body.dark-mode .option {
    border: 1px solid #4b5563;
}

body.dark-mode .option:hover {
    background: #374151;
}

body.dark-mode .stat-card {
    background: #374151;
    border: 1px solid #4b5563;
}

body.dark-mode .stat-value,
body.dark-mode .question,
body.dark-mode h2 {
    color: #f9fafb;
}

body.dark-mode .footer {
    background: #1f2937;
}

body.dark-mode .share-action {
    color: #d1d5db;
}

body.dark-mode .share-action:hover {
    color: white;
}

body:not(.dark-mode) #light-mode {
    opacity: 1;
}

body.dark-mode #dark-mode {
    opacity: 1;
}