/* Level Page Styles */

/* Image Modal Styles */
#imageModal {
    z-index: 9999;
}

#imageModal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

#modalImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* All Images Modal Styles */
#allImagesModal {
    z-index: 9999;
}

#allImagesModal .modal-dialog {
    max-width: 95vw;
    max-height: 95vh;
}

#allImagesGrid {
    max-height: 70vh;
    overflow-y: auto;
}

/* Level Images Container */
.level-images-container {
    position: relative;
}

.level-images-container img {
    transition: opacity 0.3s ease;
}

.level-images-container img:hover {
    opacity: 0.9;
}

/* Step badges */
.step-badge {
    background: rgba(36, 41, 47, 0.9);
    backdrop-filter: blur(4px);
}

/* More images overlay */
.more-images-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.more-images-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Prose styles for content */
.prose {
    color: #24292f;
    font-size: 1.1rem;
    line-height: 1.8;
}

.prose h1, 
.prose h2, 
.prose h3, 
.prose h4 {
    color: #24292f;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    color: #0969da;
    font-size: 1.5rem;
}

.prose ol, 
.prose ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.prose li {
    margin: 0.75rem 0;
    padding-left: 0.5rem;
}

.prose ol li {
    list-style: decimal;
    font-weight: 500;
}

.prose ol li strong {
    color: #0969da;
}

.prose p {
    margin: 1.25rem 0;
    line-height: 1.8;
}

.prose img {
    margin: 2rem auto;
    border-radius: 0.5rem;
    border: 1px solid #d1d9e0;
    max-width: 100%;
    height: auto;
}

/* Tab button animation */
.tab-button {
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #f6f8fa;
}

.tab-button.active {
    background-color: #24292f;
    color: white;
}

/* Sticky sidebar */
.sticky {
    position: sticky;
    top: 2rem;
}

/* Related levels hover animation */
.related-level-card {
    transition: all 0.3s ease;
}

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

/* Modal navigation buttons */
.modal-nav-btn {
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Image counter */
.image-counter {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Loading states */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sticky {
        position: static;
    }
    
    #modalImage {
        max-height: 70vh;
    }
    
    #allImagesGrid {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .prose {
        font-size: 1rem;
    }
    
    .tab-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    #modalImage {
        max-height: 60vh;
    }
    
    .modal-nav-btn {
        padding: 0.5rem;
    }
    
    #allImagesModal .modal-dialog {
        max-width: 98vw;
        margin: 1rem;
    }
    
    #allImagesGrid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .level-images-container .grid {
        gap: 0.5rem;
    }
    
    .step-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .prose {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* Animation for image grid reveal */
.image-grid-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.3s ease forwards;
}

.image-grid-item:nth-child(1) { animation-delay: 0.1s; }
.image-grid-item:nth-child(2) { animation-delay: 0.2s; }
.image-grid-item:nth-child(3) { animation-delay: 0.3s; }
.image-grid-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.tab-button:focus,
.modal-nav-btn:focus,
button:focus {
    outline: 2px solid #0969da;
    outline-offset: 2px;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .prose {
        color: #f0f6fc;
    }
    
    .prose h1, 
    .prose h2, 
    .prose h3, 
    .prose h4 {
        color: #f0f6fc;
    }
    
    .prose h3 {
        color: #58a6ff;
    }
}
