/* Reset and base styles */
/* 
* {
    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;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 50vh;
/* 
    min-height: 100vh;
 */

}

/* Header styles */
header-p {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header-p h1 {
    color: white;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.image-counter {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Main viewer styles */
.viewer-main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.image-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

.image-container {
    position: relative;
    max-width: 1200px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#main-image {
    width: 100%;
    height: auto;
    max-height: 800px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    display: none;
}

/* Navigation buttons */
.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #333;
}

.nav-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 3.33%; /* 1/30 for first image */
}

/* Thumbnails section */
.thumbnails-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.thumbnails-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-weight: 300;
    font-size: 1.8rem;
}

.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.thumbnail {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
}

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

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.thumbnail:hover img {
    transform: scale(1.1);
}

.thumbnail.active {
    border: 3px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.thumbnail-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    header-p h1 {
        font-size: 2rem;
    }
    
    .viewer-main {
        padding: 20px;
    }
    
    .image-display {
        gap: 10px;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
    }
    
    .thumbnails-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .thumbnail {
        aspect-ratio: 1;
    }
}

@media (max-width: 480px) {
    header-p h1 {
        font-size: 1.5rem;
    }
    
    .viewer-main {
        padding: 15px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .thumbnails-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        max-height: 300px;
    }
}

/* Fullscreen styles */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen .image-container {
    max-width: 90vw;
    max-height: 90vh;
}

.fullscreen #main-image {
    max-height: 90vh;
}

/* Smooth scrollbar for thumbnails */
.thumbnails-container::-webkit-scrollbar {
    width: 8px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.image-loading {
    animation: pulse 1.5s infinite;
}

