/* Difficult Letters Styles */
.ttm-difficult-letters-section {
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid #007cba;
}

.ttm-difficult-letters-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ttm-difficult-letters-section h3:before {
    content: "🔍";
    font-size: 24px;
}

.ttm-mistakes-table {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ttm-mistakes-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ttm-mistakes-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.ttm-mistakes-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.ttm-mistakes-table tr:hover td {
    background: #f8f9fa;
}

.ttm-letter-cell {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ttm-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ttm-letter-sample {
    font-size: 20px;
    color: #333;
}

.ttm-count-cell {
    color: #dc3545;
    font-weight: 500;
    font-size: 16px;
}

.ttm-practice-cell {
    text-align: center;
}

.ttm-result-actions button, .ttm-btn-small {
    padding: 8px 20px;
    font-size: 14px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.ttm-btn-small:hover {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.ttm-practice-all-section {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    margin-top: 25px;
    border: 2px dashed #dee2e6;
}

.ttm-practice-all-section h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ttm-practice-all-section h4:before {
    content: "🎯";
}

.ttm-practice-all-section p {
    color: #666;
    margin-bottom: 20px;
    font-size: 15px;
}

.ttm-practice-all {
    padding: 12px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.ttm-practice-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ttm-no-mistakes {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.ttm-no-mistakes h3 {
    margin-bottom: 15px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ttm-no-mistakes h3:before {
    content: "🎉";
}

.ttm-no-mistakes p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

.ttm-mistakes-ad {
    margin: 25px 0;
}
.ttm-result-actions {
    text-align: center;
}
.ttm-mistakes-ad > div {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px dashed #007cba !important;
    border-radius: 10px;
   /* padding: 25px !important;  */
}

.ttm-mistakes-ad h4 {
    color: #007cba;
    margin-bottom: 10px;
    font-size: 18px;
}

.ttm-mistakes-ad p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.ttm-mistakes-ad button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ttm-mistakes-ad button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ttm-difficult-letters-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .ttm-difficult-letters-section h3 {
        font-size: 20px;
    }
    
    .ttm-mistakes-table {
        font-size: 14px;
    }
    
    .ttm-letter {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .ttm-letter-sample {
        font-size: 18px;
    }
    
    .ttm-mistakes-table th,
    .ttm-mistakes-table td {
        padding: 12px 10px;
    }
    
    .ttm-practice-all-section {
        padding: 20px;
    }
    
    .ttm-practice-all-section h4 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ttm-letter-cell {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .ttm-mistakes-table th:nth-child(2),
    .ttm-mistakes-table td:nth-child(2) {
        display: none;
    }
}

























/* Practice Modal Styles */
.ttm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    animation: ttm-modal-fade-in 0.3s ease forwards;
}

.ttm-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    animation: ttm-modal-slide-up 0.3s ease forwards;
    position: relative;
}

.ttm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.ttm-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.ttm-close-modal {
    font-size: 28px;
    cursor: pointer;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ttm-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ttm-modal-body {
    padding: 30px;
}

.ttm-practice-info {
    background: #e7f3ff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #007cba;
}

.ttm-practice-info p {
    margin: 0;
    color: #005a87;
    font-weight: 500;
}

.ttm-practice-timer {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    margin: 25px 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.ttm-practice-text-display {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.6;
    min-height: 120px;
    border: 2px solid #e9ecef;
    font-family: 'Courier New', monospace;
    color: #333;
}

.ttm-practice-input {
    width: 100%;
    height: 140px;
    padding: 20px;
    border: 3px solid #007cba;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    font-family: 'Courier New', monospace;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ttm-practice-input:focus {
    outline: none;
    border-color: #005a87;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ttm-practice-completion {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    margin-top: 20px;
    color: white;
}

.ttm-practice-results h4 {
    color: white;
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 700;
}

.ttm-practice-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.ttm-practice-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.ttm-stat-value {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.ttm-stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
}

.ttm-practice-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.ttm-practice-actions .ttm-btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.ttm-practice-actions .ttm-btn:first-child {
    background: white;
    color: #f5576c;
}

.ttm-practice-actions .ttm-btn:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ttm-practice-actions .ttm-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ttm-practice-actions .ttm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes ttm-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ttm-modal-slide-up {
    from { 
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Prevent body scroll when modal is open */
body.ttm-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ttm-modal {
        padding: 10px;
    }
    
    .ttm-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .ttm-modal-header {
        padding: 20px;
    }
    
    .ttm-modal-header h3 {
        font-size: 20px;
    }
    
    .ttm-modal-body {
        padding: 20px;
    }
    
    .ttm-practice-timer {
        font-size: 28px;
        margin: 20px 0;
    }
    
    .ttm-practice-text-display {
        padding: 20px;
        font-size: 16px;
    }
    
    .ttm-practice-input {
        height: 120px;
        padding: 15px;
    }
    
    .ttm-practice-stats {
        gap: 20px;
    }
    
    .ttm-practice-stat {
        padding: 15px;
    }
    
    .ttm-stat-value {
        font-size: 28px;
    }
    
    .ttm-practice-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .ttm-practice-actions .ttm-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .ttm-modal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .ttm-practice-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .ttm-practice-text-display {
        font-size: 15px;
        padding: 15px;
    }
}














/* Debug styles - remove after testing */
.ttm-close-modal {
    background: red !important;
    z-index: 100000 !important;
}

#ttm-practice-again,
#ttm-practice-back {
    background: blue !important;
    color: white !important;
    z-index: 100000 !important;
    position: relative !important;
}

.ttm-modal-header {
    z-index: 100001 !important;
    position: relative !important;
}


















/* Practice Session Word Tracking */
.ttm-words-container {
    margin-bottom: 20px;
    line-height: 1.8;
        text-align: center;
}

.ttm-word {
    padding: 4px 8px;
    border-radius: 6px;
    margin: 2px;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;font-size: 26px;
}

.ttm-word-current {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.ttm-word-completed {
    opacity: 0.7;
}

.ttm-word-correct {
    background: #e8f5e8;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.ttm-word-wrong {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
    text-decoration: line-through;
}

.ttm-correct-char {
    color: #2e7d32;
    font-weight: bold;
}

.ttm-incorrect-char {
    color: #c62828;
    background: #ffebee;
    font-weight: bold;
    text-decoration: underline;
}

.ttm-pending-char {
    color: #666;
}

.ttm-word-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid #e9ecef;
}

.ttm-stat-item {
    text-align: center;
}

.ttm-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.ttm-stat-value {
    display: block;
  /*  font-size: 18px; */
    font-weight: bold;
    color: #007cba;
}

/* Responsive word stats */
@media (max-width: 768px) {
    .ttm-word-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .ttm-stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .ttm-stat-label {
        margin-bottom: 0;
        font-size: 14px;
    }
    
    .ttm-stat-value {
        font-size: 16px;
    }
}