
.sp-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 1500;
    overflow-y: auto;
    padding: 40px 0;
    box-sizing: border-box;
}

.sp-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sp-container {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.sp-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
}

.sp-title {
    font-size: 1.3em;
    font-weight: 700;
}


.sp-question-card {
    width: 100%;
    min-height: 180px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.btn-sp-star {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-sp-star:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.btn-sp-star.starred {
    color: #ffca28;
}

.btn-sp-speak {
    position: absolute;
    top: 20px;
    right: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-sp-speak:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    color: var(--primary);
}

.sp-question-label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 700;
}

.sp-question-text {
    font-size: 1.8em;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    color: var(--text-light);
}


.sp-input-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sp-input-wrapper {
    position: relative;
    width: 100%;
}

.sp-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 24px;
    color: var(--text-light);
    font-size: 1.15em;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sp-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}


.sp-feedback-card {
    width: 100%;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    animation: slideIn 0.3s ease;
}

.sp-feedback-card.correct {
    background: rgba(67, 160, 71, 0.1);
    border: 1px solid rgba(67, 160, 71, 0.3);
}

.sp-feedback-card.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sp-feedback-status {
    font-weight: 700;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-feedback-status.correct {
    color: #43a047;
}

.sp-feedback-status.incorrect {
    color: #ef4444;
}

.sp-feedback-detail {
    color: var(--text-light);
    font-size: 1.05em;
    line-height: 1.5;
}

.sp-feedback-original {
    color: var(--text-muted);
    font-size: 0.9em;
    text-decoration: line-through;
    opacity: 0.8;
}


.sp-action-area {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    min-height: 48px;
}

.btn-sp-action {
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sp-action.primary {
    background: var(--primary);
}

.btn-sp-action.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-sp-action.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.btn-sp-action.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}


.sp-settings-panel {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: rgba(22, 22, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
    box-sizing: border-box;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    opacity: 0;
    transform: scale(0);
    transform-origin: calc(100% - 60px) 0px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0.3s;
}

.sp-settings-panel::-webkit-scrollbar {
    width: 6px;
}

.sp-settings-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.sp-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sp-settings-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.sp-settings-panel.active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: scale(1);
}

.sp-settings-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.sp-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.sp-setting-label {
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
}

.sp-setting-description {
    font-size: 0.85em;
    color: var(--text-muted);
}

.sp-warning-text {
    font-size: 0.85em;
    color: #ef4444;
    font-weight: 500;
    display: none;
    margin-top: 4px;
}

.sp-settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.sp-settings-actions button {
    flex: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
