:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.95);
    --accent-color: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.05);
    --transition-speed: 0.4s;
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(88, 166, 255, 0.1) 0%, transparent 40%);
}

.slideshow-container {
    width: 98vw;
    height: 98vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    backdrop-filter: blur(20px);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
}

header {
    text-align: center;
    padding: 0.5rem 0;
    position: relative;
}

.header-nav {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.header-content {
    position: relative;
    z-index: 1;
}

.home-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.home-link:hover {
    color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
}

.module-label {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-color);
    color: #000;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
}

.viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    gap: 0.75rem;
    min-height: 0; /* Important for flex child to shrink */
}

.slide-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.main-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--glass-border);
}

#currentSlide {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-speed) var(--ease-elastic), 
                opacity var(--transition-speed) ease;
    opacity: 1;
}

.fade-out {
    opacity: 0 !important;
    transform: scale(0.98) !important;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    background: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev { left: 15px; }
.nav-btn.next { right: 15px; }

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.icon-btn {
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
}

.slide-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.3s ease;
}

.thumbnails-view {
    height: 90px;
    flex-shrink: 0;
}

.thumbnails-track {
    display: flex;
    gap: 10px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.thumb {
    flex: 0 0 100px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumb.active {
    opacity: 1;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Scrollbar */
.thumbnails-track::-webkit-scrollbar {
    height: 6px;
}
.thumbnails-track::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.thumbnails-track::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.playing .play-icon {
    animation: pulse 2s infinite ease-in-out;
}

/* Fullscreen mode adjustments */
:fullscreen .slideshow-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 1rem;
}
