/* --- Base Typing Test Styles --- */
#text-display,
#text-input {
    font-family: 'Roboto Mono', monospace;
}

#text-display {
    height: 120px;
    overflow-y: auto;
    line-height: 2rem;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Character highlighting for code */
.letter.correct {
    color: #166534;
    /* Dark Green */
    background-color: #dcfce7;
    /* Light Green */
}

.letter.incorrect {
    color: #991b1b;
    /* Dark Red */
    background-color: #fee2e2;
    /* Light Red */
    text-decoration: underline;
    text-decoration-color: #ef4444;
}

/* --- Specific Styles for Code/Math Page --- */
.setting-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    background-color: #f3f4f6;
    color: #4b5563;
}

.setting-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.setting-btn.javascript.active {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.setting-btn.python.active {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

.setting-btn.html.active {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.setting-btn.math.active {
    background-color: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

/* --- How-to Steps Section --- */
.step-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    font-size: 3rem;
}

.step-icon-1 {
    background-color: #e0f2fe;
    color: #0ea5e9;
}

.step-icon-2 {
    background-color: #e0e7ff;
    color: #4338ca;
}

.step-icon-3 {
    background-color: #dcfce7;
    color: #22c55e;
}

/* --- FAQ Section Styles --- */
.faq-entry {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.faq-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.faq-answer p {
    color: #4b5563;
    line-height: 1.6;
}

/* --- Certificate Modal & Certificate Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
}

#certificate-preview-container {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
}

#certificate {
    width: 800px;
    height: 565px;
    border: 10px solid #4f46e5;
    padding: 2rem;
    background: linear-gradient(to bottom right, #ffffff, #f3f4f6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Times New Roman', serif;
}

#certificate-header {
    text-align: center;
}

#certificate-header h1 {
    font-size: 3rem;
    color: #3730a3;
    font-weight: bold;
    margin: 0;
}

#certificate-header h2 {
    font-size: 1.5rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

#certificate-body {
    text-align: center;
    margin: 2rem 0;
}

#certificate-body p {
    font-size: 1.25rem;
    color: #374151;
    line-height: 1.8;
}

#certificate-body .user-name {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1e293b;
    border-bottom: 2px solid #9ca3af;
    display: inline-block;
    padding-bottom: 0.5rem;
    margin: 1rem 0;
}

#certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: #4b5563;
}