/* Scoped styles to prevent affecting WordPress theme */
.mtt-container {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 5px;
    position: relative;
}

.mtt-title {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    background: linear-gradient(to right, #FF9800, #4CAF50);
    color: white;
    padding: 15px;
    border-radius: 5px;
}

.mtt-card {
    background: #fff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.mtt-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.mtt-language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    min-width: 200px;
}

.mtt-language-label {
    background: #c62828;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    white-space: nowrap;
}

.mtt-language-dropdown {
    background: #1976D2;
    color: white;
    padding: 8px 35px 8px 15px;
    border: 1px solid #1565C0;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: auto;
    min-width: 150px;
    max-width: 200px;
    transition: all 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.mtt-language-dropdown:hover {
    background: #1565C0;
    border-color: #0D47A1;
}

.mtt-language-dropdown option {
    background: #ffffff;
    color: #333;
    padding: 10px;
}

.mtt-language-dropdown option:hover {
    background: #1976D2;
    color: white;
}

.mtt-highlight-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #9c27b0;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    min-width: 200px;
    justify-content: flex-end;
}

.mtt-toggle-label {
    font-weight: bold;
    order: 1;
}

.mtt-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    order: 2;
}

.mtt-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mtt-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c62828;
    transition: .4s;
    border-radius: 34px;
}

.mtt-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .mtt-toggle-slider {
    background-color: #4CAF50;
}

input:checked + .mtt-toggle-slider:before {
    transform: translateX(30px);
}

.mtt-toggle-state {
    margin-left: 10px;
    font-weight: bold;
    color: #4CAF50;
    order: 3;
    min-width: 30px;
    text-align: center;
}

.mtt-text-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    margin-bottom: 15px;
}

.mtt-reference-text {
    padding: 15px;
    line-height: 1.8;
    font-size: 16px;
    background: #fff;
    color: #333;
    text-align: justify;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mtt-reference-text span {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.mtt-no-text {
    color: #c62828;
    font-style: italic;
}

.mtt-user-input {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    resize: none;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.8;
    text-align: justify;
}

.mtt-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.mtt-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 100px;
    text-align: center;
}

.mtt-btn-start {
    background: #4CAF50;
    color: white;
}

.mtt-btn-reset {
    background: #FFC107;
    color: #333;
}

.mtt-timer-container {
    display: none;
    margin: 15px 0;
}

.mtt-timer {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    background: #FFF9C4;
}

.mtt-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.mtt-stat-box {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.mtt-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #2E7D32;
}

.mtt-current-char {
    background: #FFEB3B;
    border-radius: 2px;
}

.mtt-correct {
    color: #2E7D32;
}

.mtt-incorrect {
    color: #c62828;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .mtt-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mtt-text-container, .mtt-user-input {
        height: 200px;
    }
    
    .mtt-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mtt-language-selector {
        width: 100%;
    }
    
    .mtt-highlight-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .mtt-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .mtt-container {
        padding: 10px;
    }
    
    .mtt-card {
        padding: 10px;
    }
    
    .mtt-stats {
        grid-template-columns: 1fr;
    }
    
    .mtt-language-dropdown {
        min-width: 100%;
        max-width: 100%;
    }
    
    .mtt-btn {
        flex-grow: 1;
    }
}