* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 95%;
    max-width: 1600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.image-viewer {
    display: flex;
    flex-direction: column;
    height: 90vh;
    min-height: 800px;
}

.image-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: hidden;
    cursor: pointer;
}

#current-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#current-image:hover {
    /* Remove the hover scale effect when zoomed to avoid conflicts */
}

#current-image.zoomed {
    cursor: grab;
}

#current-image.zoomed:active {
    cursor: grabbing;
}

/* Image Overlay for Enlarged View */
.image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.image-overlay.active {
    display: flex;
}

#enlarged-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ff6b6b;
}

.controls {
    background: white;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nav-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.image-info {
    text-align: center;
    color: #666;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#image-counter {
    font-weight: 600;
    color: #333;
}

#image-filename {
    font-size: 14px;
    color: #888;
}

.zoom-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.zoom-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

.video-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    color: white !important;
    border: 2px solid #ff6b6b !important;
}

.video-btn:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%) !important;
    border-color: #ee5a24 !important;
    color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 98%;
        margin: 5px;
    }
    
    .image-viewer {
        height: 85vh;
        min-height: 600px;
    }
    
    .controls {
        padding: 15px;
    }
    
    .navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 200px;
        margin: 5px 0;
    }
    
    .zoom-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .zoom-btn {
        width: 120px;
        margin: 2px 0;
    }
}

@media (max-width: 480px) {
    .image-viewer {
        height: 75vh;
        min-height: 500px;
    }
    
    .nav-btn {
        width: 150px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .zoom-btn {
        width: 100px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions for image changes */
.image-transition {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.image-transition.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#video-player {
    width: 100%;
    max-width: 1200px;
    max-height: 70vh;
    display: block;
}

.video-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-close-btn:hover {
    background: rgba(255, 107, 107, 0.8);
}

.video-info {
    padding: 20px;
    background: white;
}

.video-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.video-info p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
}

.video-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.video-nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.video-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.video-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
}

.back-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
}

/* Pulse animation for video end notification */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Video List Modal */
.video-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.video-list-modal.active {
    display: flex;
}

.video-list-content {
    position: relative;
    max-width: 80%;
    max-height: 80%;
    background: white;
    border-radius: 15px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.video-list-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 28px;
}

.video-list-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}

.video-list-close-btn:hover {
    color: #ff6b6b;
}

.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.video-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-item h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.video-item p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.play-video-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.play-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Video Styles */
@media (max-width: 768px) {
    .video-list-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .video-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #video-player {
        max-height: 50vh;
    }
    
    .video-info {
        padding: 15px;
    }
    
    .video-info h3 {
        font-size: 20px;
    }
    
    .video-info p {
        font-size: 14px;
    }
    
    .video-navigation {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .video-nav-btn {
        width: 200px;
        font-size: 13px;
        padding: 10px 16px;
    }
}
