/* Dashboard Specific Styles */

body {
    background: #f5f7fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Adjustments */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e1e8ed;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: background 0.3s ease;
}

.user-menu:hover {
    background: rgba(102, 126, 234, 0.1);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
    color: #333;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e1e8ed;
    position: fixed;
    left: 0;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-content {
    padding: 1.5rem 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateX(5px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: #667eea;
    border-right: 3px solid #667eea;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.new-badge {
    background: #10b981;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.new-badge:contains("GAME") {
    background: #f59e0b;
}

/* Alternative approach for GAME badges */
[data-section="scrambify"] .new-badge,
[data-section="memorybo"] .new-badge {
    background: #f59e0b;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    max-width: calc(100vw - 260px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #64748b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Dashboard Section */
.dashboard-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.lesson-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-2px);
}

.lesson-flag {
    font-size: 2.5rem;
    margin-right: 1rem;
}

.lesson-content {
    flex: 1;
}

.lesson-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.lesson-description {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1rem 0;
}

.lesson-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.lesson-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lesson-button:hover {
    transform: scale(1.05);
}

/* Grammar Checker Styles */
.grammar-checker-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.grammar-input-section,
.grammar-results-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.input-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.language-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
}

.grammar-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.grammar-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.grammar-actions {
    display: flex;
    gap: 1rem;
}

.grammar-results {
    min-height: 300px;
}

.results-placeholder {
    text-align: center;
    color: #64748b;
    padding: 3rem 1rem;
}

.results-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.results-placeholder h3 {
    margin: 0 0 0.5rem 0;
    color: #475569;
}

.error-item {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.error-type {
    font-weight: 600;
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.error-message {
    color: #374151;
    margin-bottom: 0.5rem;
}

.error-suggestion {
    color: #059669;
    font-style: italic;
    font-size: 0.9rem;
}

/* Grammar Tips */
.grammar-tips-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.grammar-tips-section h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tip-card h4 {
    color: #1e293b;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.tip-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Placeholder Content */
.placeholder-content {
    background: white;
    border-radius: 15px;
    padding: 4rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    color: #64748b;
}

.placeholder-content i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.placeholder-content h3 {
    color: #475569;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grammar-checker-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }
    
    .dashboard-container {
        flex-direction: column;
        margin-top: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .lesson-card {
        flex-direction: column;
        text-align: center;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .grammar-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .user-name {
        display: none;
    }
}

/* ==========================================
   GAME SECTIONS - SCRAMBIFY & MEMORYBO
   ========================================== */

/* Game Menu Styles */
.game-menu {
    max-width: 1000px;
    margin: 0 auto;
}

.game-intro {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.game-description h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.game-description ul {
    list-style: none;
    padding: 0;
}

.game-description li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    color: #666;
}

.game-description li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    margin-right: 1rem;
}

/* Difficulty Selection */
.difficulty-selection {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.difficulty-selection h3 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.difficulty-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    background: white;
    border: 3px solid #e1e8ed;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.difficulty-btn.easy {
    border-color: #4ade80;
}

.difficulty-btn.easy:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.difficulty-btn.medium {
    border-color: #f59e0b;
}

.difficulty-btn.medium:hover {
    border-color: #d97706;
    background: #fffbeb;
}

.difficulty-btn.hard {
    border-color: #dc2626;
}

.difficulty-btn.hard:hover {
    border-color: #b91c1c;
    background: #fef2f2;
}

.difficulty-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.difficulty-btn span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.difficulty-btn small {
    color: #666;
    font-size: 0.9rem;
}

/* Game Interface */
.game-interface {
    max-width: 1000px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.game-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.level-indicator,
.score,
.matches-count,
.attempts-count {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.level-indicator span,
.score span,
.matches-count span,
.attempts-count span {
    color: #667eea;
}

.btn-back {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
}

.btn-back:hover {
    background: #4b5563;
}

.game-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Scrambify Specific Styles */
.word-container h3 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.letters-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.letter-tile {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: grab;
    transition: transform 0.2s ease;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.letter-tile:hover {
    transform: scale(1.05);
}

.letter-tile:active {
    cursor: grabbing;
}

.letter-tile.dragging {
    opacity: 0.7;
    transform: rotate(5deg);
}

/* Memory Game Styles */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 2rem auto;
}

.memory-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    padding: 1rem;
    position: relative;
}

.memory-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.memory-card.flipped {
    background: white;
    color: #333;
    border: 2px solid #667eea;
}

.memory-card.matched {
    background: #22c55e;
    color: white;
    cursor: default;
}

.memory-card.matched:hover {
    transform: none;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 10px;
}

/* Game Feedback */
.game-feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    min-height: 20px;
}

.game-feedback.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.game-feedback.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.game-feedback.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.hint-display {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #d97706;
    font-weight: 500;
    display: none;
}

.hint-display.show {
    display: block;
}

/* Start Game Section */
.start-game-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Responsive Design for Games */
@media (max-width: 768px) {
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .letters-container {
        gap: 0.25rem;
    }
    
    .letter-tile {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .memory-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .memory-card {
        min-height: 100px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .memory-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .letter-tile {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ==========================================
   LESSONS SECTION - COURSE CARDS
   ========================================== */

.lessons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.course-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.course-card.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.course-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.course-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.course-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.course-info {
    flex: 1;
}

.course-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.course-description {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.course-meta i {
    color: #667eea;
}

.course-actions {
    text-align: center;
}

.course-btn {
    width: 100%;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.course-btn.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.course-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.course-btn.btn-secondary {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.course-btn:disabled {
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive Design for Course Cards */
@media (max-width: 768px) {
    .lessons-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .course-card {
        padding: 1.5rem;
    }
    
    .course-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .course-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .course-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .course-card {
        padding: 1rem;
    }
    
    .course-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}