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

#text-display {
    height: 140px;
    /* A bit more height for custom text */
    overflow-y: auto;
    line-height: 2rem;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    word-break: break-word;
}

.word.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 2px;
    bottom: 2px;
    width: 2px;
    background-color: #4f46e5;
    /* Indigo */
    animation: blink 1s infinite;
    border-radius: 1px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.word {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
}

.letter.correct {
    color: #10b981;
}

.letter.incorrect {
    color: #ef4444;
    text-decoration: underline;
}

/* --- 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;
}