/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f0f11;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #ffffff;
    overflow: hidden; 
}

a {
    text-decoration: none;
    color: #fff;
}

button, .download-btn {
    color: white !important;
    background: hsl(from white h s l / .125) !important;
    backdrop-filter: blur(0);
    padding: 1rem 1.25rem;
    border-radius: 100vh;
    transition: all 250ms ease;

    &:hover{
        background: hsl(from white h s l / .5) !important;
        backdrop-filter: blur(10px);
    }
}

.download-btn a {
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    font-size: .85em !important;
}

/* --- Loader Overlay Styles --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f0f11;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;

    a{
        position: absolute;
        bottom: 5rem;
        left: 50%;
        transform: translateX(-50%);
        text-decoration: underline;
        color: hsl(from white h s 50%);

        &:hover{
            color: white;
        }

        span{
            margin-left: .5rem;
            text-transform: uppercase;
        }
    }
}

.scanner-container {
    --img-width: 10rem;
    position: relative;
    display: inline-block;
}

.scan-base {
    display: flex;
}
.scan-base img {
    width: var(--img-width);
}

.scan-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #eb1b26;
    display: flex;
    overflow: hidden;
    -webkit-mask-image: conic-gradient(#fff var(--progress, 0%), transparent 0);
    mask-image: conic-gradient(#fff var(--progress, 0%), transparent 0);
}

.scan-fill img {
    width: var(--img-width);
}

.scan-line {
    position: absolute;
    top: -10%;
    left: 50%;
    width: 2px;
    height: 60%;
    margin-left: -1px;
    background: #ffffff;
    box-shadow: 0 0 10px #ffffff, 0 0 20px var(--clr-blue), 0 0 40px var(--clr-blue);
    transform-origin: bottom center;
    rotate: var(--progress-deg, 0deg);
    scale: 1 0;
    transition: rotate 0.1s linear, scale 0.4s ease-in-out;
    z-index: 2;
}

.scanner-container.loading-started .scan-line {
    scale: 1 1;
}

.scanner-container.loading-complete .scan-line {
    scale: 1 0;
}

.scan-percentage {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: .85rem;
    font-weight: 300;
    color: #eb1b26;
    text-shadow: 0 0 10px hsl(from #eb1b26 h  s l / .5);
}

/* Presentation Container & Scroll Snapping */
#presentation {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative; 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

#presentation::-webkit-scrollbar {
    display: none; 
}

/* Individual Slide Section */
.slide {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; 
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none; 
    -webkit-user-drag: none; 
    transition: transform 0.15s ease-out; 
    transform-origin: center center;
}

/* --- OPTIMIZED MOBILE DRAG CLASSES --- */
.slide img.zoom-active {
    cursor: grab;
    touch-action: none; 
    will-change: transform; 
}
.slide img.dragging {
    cursor: grabbing;
    transition: none; 
}

/* --- UI Bars Fixed & Hover Styles --- */
.ui-bar {
    position: fixed;
    left: 0;
    right: 0;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    z-index: 100;
    opacity: 0.25; 
    transition: opacity 0.3s ease;
}

.ui-bar .container {
    width: 90%;
    margin-inline: auto;
    display: flex;
    justify-content: space-between;
}

.ui-bar:hover {
    opacity: 1;
}

#top-bar {
    top: 0;
    background: linear-gradient(to bottom, var(--background, #0f0f11) 5%, rgba(15, 15, 17, 0.25) 80%, transparent 100%);
}

#bottom-bar {
    bottom: 0;
    justify-content: center;
    gap: 30px;
    background: linear-gradient(to top, var(--background, #0f0f11) 5%, transparent 100%);
}

.nav-btn {
    border: none;
    font-size: 24px;
    padding: 0 15px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.nav-btn:hover {
    transform: scale(1.2);
}

@media (max-width: 600px) {
    .ui-bar { padding: 15px; opacity: 0.6; }
    .nav-btn, .download-btn { padding: 8px 15px; font-size: 14px; }
}

/* --- Editable Slide Indicator Styles --- */
#slide-indicator-container {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

#slide-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: .25rem;
    padding: .125rem;
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    width: 3.5ch; 
    outline: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    transition: border-bottom 0.3s ease;
}

#slide-input:focus {
    border-bottom: 1px solid #fff;
}

#slide-input::-webkit-outer-spin-button,
#slide-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#slide-input[type=number] {
    -moz-appearance: textfield; 
}

/* --- ZOOM CONTROLS (Bottom Right) --- */
#zoom-wrapper {
    position: fixed;
    bottom: 1rem;
    right: 10%;
    display: flex;
    align-items: center;
    background: hsl(from var(--background) h s l / .5);
    border-radius: 100vh;
    padding: .25rem .35rem;
    z-index: 101; 
    backdrop-filter: blur(10px);
}

#zoom-slider-container {
    width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin 0.3s ease;
    opacity: 0;
}

#zoom-slider-container.active {
    width: 12rem;
    margin-right: 1rem;
    opacity: 1;
}

#zoom-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 1rem;
    width: 1rem;
    border-radius: 50%;
    background: #eb1b26;
    margin-top: -5.5px;
}

#zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: hsl(from #fff h s l / .5);
    border-radius: 2px;
}

.zoom-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.zoom-btn:hover {
    transform: scale(1.1);
    color: #eb1b26;
}