/* assets/css/frontend.css */

/* Lessons Grid */
.typing-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.typing-lesson-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.typing-lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.typing-lesson-card h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.lesson-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Chapters List */
.typing-lesson-chapters {
    margin: 30px 0;
}

.chapters-list {
    display: grid;
    gap: 15px;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
}

.chapter-type {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Typing Practice Container */
#typing-practice-container {
    position: relative;
    min-height: 400px;
    margin: 20px 0;
}

/* Slide Animations */
.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.5s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Slides Container */
.slides-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.slide-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.slide-content {
    min-height: 300px;
    line-height: 1.6;
}

/* Typing Test */
.typing-test-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.typing-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 6px;
    font-weight: bold;
}

.text-display {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fafafa;
    min-height: 150px;
    line-height: 1.8;
}

.text-line {
    margin-bottom: 8px;
}

.input-area textarea {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-area textarea:focus {
    border-color: #007cba;
    outline: none;
}

/* Message Bubbles */
.message-bubbles {
    position: relative;
    min-height: 100px;
}

.message-bubble {
    position: absolute;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.message-bubble::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .typing-lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .typing-stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}




















/* Add to assets/css/frontend.css */

/* Message Bubbles */
.message-bubble {
    position: absolute;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.message-bubble.above_keyboard,
.message-bubble.above_typing_text_area,
.message-bubble.above_text_area {
    background: #007cba;
    color: white;
    border: none;
}

.message-bubble.in_keyboard,
.message-bubble.in_typing_text_area,
.message-bubble.in_text_area {
    background: rgba(0, 124, 186, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: none;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
}

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

/* Chapter Navigation */
.chapters-navigation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.chapters-list {
    display: grid;
    gap: 10px;
}

.chapter-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-nav-item:hover {
    background: #e9ecef;
}

.chapter-nav-item.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.chapter-number {
    background: #6c757d;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.chapter-nav-item.active .chapter-number {
    background: white;
    color: #007cba;
}

.chapter-type-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: auto;
}

/* Introduction Slides */
.introduction-slide {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.slide-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.slide-content {
    min-height: 300px;
    line-height: 1.6;
}

.slide-content img {
    max-width: 100%;
    height: auto;
}

/* Typing Practice */
.typing-practice {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.stats-container {
    display: flex;
    gap: 20px;
}

.stat {
    font-weight: bold;
    color: #495057;
}

.text-display-area {
    margin-bottom: 20px;
}

.reference-text {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    background: #f8f9fa;
    margin-bottom: 15px;
    min-height: 120px;
}

.text-line {
    margin-bottom: 8px;
    line-height: 1.5;
}

.typing-input {
    width: 100%;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.typing-input:focus {
    border-color: #007cba;
    outline: none;
}

.messages-area {
    position: relative;
    min-height: 100px;
    margin: 20px 0;
}

.practice-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}