/* Learning Path System - Duolingo-style UI */

/* Modal Container */
.learning-path-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100010;
}

.learning-path-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.learning-path-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.learning-path-container {
    position: relative;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: lpSlideIn 0.3s ease-out;
}

@keyframes lpSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.learning-path-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.lp-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lp-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.lp-header-content {
    flex: 1;
}

.lp-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.lp-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
}

.lp-xp-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.lp-xp-icon {
    font-size: 1.25rem;
}

.lp-xp-value {
    font-size: 1.25rem;
    font-weight: 800;
}

.lp-xp-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.lp-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lp-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Content Area */
.learning-path-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Path Selection Grid */
.lp-paths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.lp-path-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.lp-path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--path-color, #4CAF50);
}

.lp-path-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--path-color, #4CAF50);
}

.lp-path-card.locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.lp-path-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.lp-path-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.lp-path-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.lp-locked-badge {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
}

.lp-path-progress {
    margin-bottom: 1rem;
}

.lp-progress-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.lp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--path-color, #4CAF50), var(--path-color, #4CAF50));
    border-radius: 5px;
    transition: width 0.5s ease;
}

.lp-progress-text {
    font-size: 0.8rem;
    color: #6b7280;
}

.lp-path-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--path-color, #4CAF50);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lp-path-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Path Header Banner */
.lp-path-header-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
    color: white;
    margin-bottom: 1.5rem;
}

.lp-path-banner-icon {
    font-size: 2.5rem;
}

.lp-path-banner-info h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
}

.lp-path-banner-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* Sections List */
.lp-sections-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lp-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.lp-section:hover:not(.locked) {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.lp-section.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.lp-section-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lp-section-info {
    flex: 1;
}

.lp-section-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.lp-section-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.lp-section-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lp-mini-progress {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.lp-mini-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

.lp-section-progress span {
    font-size: 0.8rem;
    color: #6b7280;
}

.lp-section-arrow {
    font-size: 1.25rem;
    color: #9ca3af;
}

/* Units Path (Duolingo-style) */
.lp-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.lp-section-header-icon {
    font-size: 2rem;
}

.lp-section-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
}

.lp-units-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
}

.lp-unit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lp-unit-connector {
    width: 4px;
    height: 40px;
    background: #e5e7eb;
    border-radius: 2px;
}

.lp-unit-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.lp-unit-node:hover:not(.locked) {
    transform: scale(1.05);
}

.lp-unit-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 4px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #9ca3af;
    transition: all 0.3s;
}

.lp-unit-node.active .lp-unit-circle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    animation: lpPulse 2s infinite;
}

@keyframes lpPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 8px 35px rgba(102, 126, 234, 0.6); }
}

.lp-unit-node.complete .lp-unit-circle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.lp-unit-node.locked .lp-unit-circle {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.lp-unit-label {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #4b5563;
    text-align: center;
    max-width: 120px;
}

.lp-unit-badge {
    position: absolute;
    top: -10px;
    right: -20px;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    animation: lpBounce 1s infinite;
}

@keyframes lpBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Unit Header */
.lp-unit-header {
    margin-bottom: 1.5rem;
}

.lp-unit-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
}

/* Lessons List */
.lp-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lp-lesson {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.lp-lesson:hover:not(.locked) {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.lp-lesson.complete {
    background: #f0fdf4;
    border-color: #10b981;
}

.lp-lesson.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.lp-lesson-status {
    font-size: 1.25rem;
    width: 30px;
    text-align: center;
}

.lp-lesson-info {
    flex: 1;
}

.lp-lesson-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.lp-lesson-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.lp-lesson-type {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Lesson Action Buttons */
.lp-lesson-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.lp-lesson-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lp-build-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.lp-build-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.lp-review-btn {
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #e5e7eb;
}

.lp-review-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.lp-lesson.complete .lp-build-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.lp-lesson.complete .lp-review-btn {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.lp-lesson-xp {
    color: #f59e0b;
    font-weight: 600;
}

.lp-lesson-action {
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    padding: 0.5rem 1rem;
    background: #eef2ff;
    border-radius: 10px;
}

.lp-lesson.complete .lp-lesson-action {
    color: #10b981;
    background: #d1fae5;
}

/* Lesson Tracker (floating) */
.lesson-tracker {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1.25rem;
    z-index: 100005;
    transition: transform 0.3s ease;
}

.lesson-tracker.visible {
    transform: translateX(-50%) translateY(0);
}

.lesson-tracker-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-tracker-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-tracker-icon {
    font-size: 1.25rem;
}

.lesson-tracker-name {
    font-weight: 700;
    color: #1f2937;
}

.lesson-complete-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lesson-complete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Celebration Modal */
.lp-celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100020;
    animation: lpFadeIn 0.3s ease;
}

@keyframes lpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lp-celebration-content {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    max-width: 350px;
    animation: lpPopIn 0.4s ease;
}

@keyframes lpPopIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lp-celebration-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: lpCelebrate 0.5s ease;
}

@keyframes lpCelebrate {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.lp-celebration-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.lp-celebration-xp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.lp-xp-earned {
    font-size: 2rem;
    font-weight: 800;
    color: #f59e0b;
}

.lp-celebration-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.lp-celebration-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lp-celebration-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Attach/Detach Icons in Code Title */
.attach-icon, .detach-icon {
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
}

.attach-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.detach-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.attach-icon:hover, .detach-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .learning-path-container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .learning-path-header {
        padding: 1rem;
    }
    
    .lp-title {
        font-size: 1.25rem;
    }
    
    .lp-xp-display {
        padding: 0.4rem 0.75rem;
    }
    
    .lp-paths-grid {
        grid-template-columns: 1fr;
    }
    
    .lp-unit-circle {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    .lesson-tracker {
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(100px);
    }
    
    .lesson-tracker.visible {
        transform: translateX(0) translateY(0);
    }
}
