/**
 * LearnFlash Course Projects Styles
 * Responsive 3-column grid for course projects
 */

.learnflash-course-projects {
    margin: 20px 0;
}

.learnflash-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
}

.learnflash-project-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.learnflash-project-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

a.learnflash-project-image,
.learnflash-project-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.learnflash-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.learnflash-project-item:hover .learnflash-project-image img {
    transform: scale(1.05);
}

.learnflash-project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.learnflash-project-item:hover .learnflash-project-overlay {
    opacity: 1;
}

.learnflash-play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.learnflash-play-button:before {
    content: "▶";
    font-size: 20px;
    color: #333;
    margin-left: 3px; /* Optical alignment for play button */
}

.learnflash-project-item:hover .learnflash-play-button {
    transform: scale(1.1);
}

a.learnflash-project-title,
.learnflash-project-title {
    padding: 15px;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.learnflash-project-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.learnflash-project-item:hover .learnflash-project-title h3 {
    color: #007cba;
}

/* Error and empty state messages */
.learnflash-error,
.learnflash-no-projects {
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    color: #721c24;
    margin: 20px 0;
}

.learnflash-no-projects {
    border-left-color: #6c757d;
    color: #495057;
}

/* Tablet responsiveness (768px and below) */
@media (max-width: 768px) {
    .learnflash-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .learnflash-project-image {
        height: 160px;
    }
    
    .learnflash-project-title {
        padding: 12px;
    }
    
    .learnflash-project-title h3 {
        font-size: 15px;
    }
    
    .learnflash-play-button {
        width: 50px;
        height: 50px;
    }
    
    .learnflash-play-button:before {
        font-size: 16px;
    }
}

/* Mobile responsiveness (480px and below) */
@media (max-width: 480px) {
    .learnflash-projects-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .learnflash-course-projects {
        margin: 15px 0;
    }
    
    .learnflash-project-image {
        height: 180px;
    }
    
    .learnflash-project-title {
        padding: 10px;
    }
    
    .learnflash-project-title h3 {
        font-size: 14px;
    }
    
    .learnflash-play-button {
        width: 45px;
        height: 45px;
    }
    
    .learnflash-play-button:before {
        font-size: 14px;
    }
}

/* Extra small mobile (320px and below) */
@media (max-width: 320px) {
    .learnflash-projects-grid {
        gap: 10px;
    }
    
    .learnflash-project-image {
        height: 160px;
    }
    
    .learnflash-project-title {
        padding: 8px;
    }
}

/* Fallback modal styles */
.learnflash-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.learnflash-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.learnflash-modal-content iframe {
    width: 100%;
    height: 100%;
}

.learnflash-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s;
}

.learnflash-close:hover {
    opacity: 0.7;
}