/* Home Page Styles */

/* Level Card Styles */
.level-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.level-card:hover {
    transform: translateY(-5px);
    border-color: #C248FD;
    box-shadow: 0 15px 30px rgba(194, 72, 253, 0.2);
}

.level-card-placeholder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.level-card-placeholder .bg-gray-200 {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Level Badge */
.level-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #C248FD, #A855F7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(194, 72, 253, 0.3);
}

/* Level Image */
.level-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.level-card:hover .level-image {
    transform: scale(1.05);
}

/* Level Content */
.level-content {
    padding: 16px;
}

.level-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
}

.level-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.level-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
}

.level-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.level-difficulty {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.difficulty-easy {
    background: #dcfce7;
    color: #166534;
}

.difficulty-medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-hard {
    background: #fee2e2;
    color: #991b1b;
}

/* Level Tab Buttons */
.level-tab-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.level-tab-btn:hover::before {
    left: 100%;
}

/* Loading States */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #C248FD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error States */
.error-state {
    text-align: center;
    padding: 48px 24px;
}

.error-icon {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-message {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.error-submessage {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .level-card {
        margin-bottom: 16px;
    }
    
    .level-image {
        height: 160px;
    }
    
    .level-title {
        font-size: 14px;
    }
    
    .level-description {
        font-size: 13px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Layout */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
