/* ============================================
   IMAGE SCROLLER 3000 — Gallery Styles
   throbbing.click retro mid-2000s aesthetic
   ============================================ */

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
}

html {
    background: #0b3d91;
    min-height: 100%;
}

body {
    margin: 0;
    color: #eaf4ff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 90px),
        repeating-linear-gradient(0deg, rgba(0,0,0,.03) 0 1px, transparent 1px 90px),
        linear-gradient(180deg, #0a1628 0%, #0b3d91 40%, #0b3d91 100%);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Page Shell --- */
.page-shell {
    max-width: 1180px;
    min-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* --- Masthead --- */
.gallery-masthead {
    border: 3px solid #003c96;
    background: linear-gradient(#fff, #d9edff 45%, #ffc31f 46%, #ffeb86);
    box-shadow: 0 0 0 2px #fff inset, 0 5px 15px rgba(0,0,0,.25);
    margin-bottom: 8px;
}

.topline {
    display: flex;
    justify-content: space-around;
    padding: 4px 8px;
    color: #fff;
    font-size: 12px;
    background: #003c96;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: bold;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 20px;
}

.gallery-title {
    margin: 0;
    color: #003c96;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #ffc31f, 3px 3px 0 rgba(0,0,0,.15);
    letter-spacing: -0.02em;
    font-family: "Arial Black", Arial, sans-serif;
}

.floating-deal {
    background: #d60000;
    color: #fff;
    padding: 4px 12px;
    border: 2px solid #fff;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: 2px 2px 0 #003c96, 0 0 0 2px #003c96;
    transform: rotate(-3deg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-4px) rotate(-1deg); }
}

.blink {
    animation: blink 1.2s steps(2, end) infinite;
}

@keyframes blink {
    50% { opacity: 0.2; }
}

/* --- Status Bar --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(#003c96, #002466);
    border: 3px solid #003c96;
    box-shadow: 0 0 0 2px #fff inset, 0 3px 8px rgba(0,0,0,.2);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.status-left,
.status-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.now-viewing {
    color: #ffc31f;
    text-shadow: 1px 1px 0 #000;
}

.image-counter {
    color: #fff;
    font-family: "Courier New", monospace;
}

.fake-stats {
    color: #b8d4ff;
}

.fake-counter {
    color: #ffc31f;
    font-family: "Courier New", monospace;
    background: #000;
    padding: 1px 6px;
    border: 1px solid #ffc31f;
}

/* --- Gallery Container & Film Reel --- */
.gallery-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    min-height: 500px;
}

.film-reel-frame {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: 75vh;
    min-height: 500px;
    max-height: 800px;
    background: #0a0a0a;
    border: 4px solid #003c96;
    box-shadow:
        0 0 0 2px #fff inset,
        0 0 0 7px #003c96 inset,
        0 0 0 9px #ffc31f inset,
        0 8px 25px rgba(0,0,0,.5),
        inset 0 0 60px rgba(0,0,0,.8);
    border-radius: 4px;
    display: flex;
}

/* Film reel decorative ends */
.reel-left,
.reel-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 70%;
    background:
        repeating-linear-gradient(
            0deg,
            #1a1a1a 0px,
            #1a1a1a 8px,
            #2a2a2a 8px,
            #2a2a2a 16px
        );
    border: 2px solid #444;
    border-radius: 2px;
    z-index: 2;
    box-shadow: inset 0 0 4px rgba(0,0,0,.8);
}

.reel-left {
    left: 6px;
}

.reel-right {
    right: 6px;
}

/* Film perforations - sprocket holes */
.perforations {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 14px;
    background-image:
        radial-gradient(
            ellipse 5px 7px at center,
            #000 0%,
            #000 50%,
            transparent 51%
        );
    background-size: 14px 24px;
    background-repeat: repeat-y;
    background-position: center 6px;
    z-index: 1;
}

.left-perf {
    left: 0;
}

.right-perf {
    right: 0;
}

/* --- Viewport - The image display area --- */
.viewport {
    flex: 1;
    margin: 0 36px;
    background: #000;
    border: 2px solid #222;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,.9),
        0 0 0 1px #444;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

/* Subtle CRT scanlines */
.viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 3px
    );
    pointer-events: none;
    z-index: 3;
}

/* CRT vignette */
.viewport::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0,0,0,0.6) 100%
    );
    pointer-events: none;
    z-index: 2;
}

.image-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    will-change: transform;
    padding: 20px 0;
}

.image-track img {
    max-width: 100%;
    max-height: 50%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,.6);
    background: #111;
    display: block;
}

/* --- Control Bar --- */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    margin-top: 8px;
    background: linear-gradient(#d9edff, #a8c8e8);
    border: 3px solid #003c96;
    box-shadow: 0 0 0 2px #fff inset, 0 4px 12px rgba(0,0,0,.2);
}

.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.left-controls,
.right-controls {
    flex: 1;
}

.right-controls {
    justify-content: flex-end;
}

/* --- Retro Buttons --- */
.retro-button {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
}

.button-top {
    display: block;
    width: 100%;
    height: 6px;
    background: linear-gradient(#fff, #d9edff);
    border: 2px solid #003c96;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}

.button-label {
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: linear-gradient(#fff, #d9edff 50%, #b8d4ff);
    color: #003c96;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 2px solid #003c96;
    border-right: 2px solid #003c96;
    text-align: center;
    transition: all 0.1s ease;
}

.button-bottom {
    display: block;
    width: 100%;
    height: 6px;
    background: linear-gradient(#888, #555);
    border: 2px solid #003c96;
    border-top: 0;
    border-radius: 0 0 4px 4px;
}

.retro-button:hover .button-label {
    background: linear-gradient(#fff, #ffc31f 50%, #ff9900);
    color: #003c96;
}

.retro-button:active {
    transform: translateY(2px);
}

.retro-button:active .button-label {
    background: linear-gradient(#b8d4ff, #fff 50%, #d9edff);
    box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}

.retro-button:active .button-top {
    height: 4px;
}

.retro-button:active .button-bottom {
    height: 4px;
}

/* Play/Pause special styling */
.play-pause {
    min-width: 140px;
}

.play-pause .button-label {
    font-size: 16px;
    color: #d60000;
    text-shadow: 1px 1px 0 #fff;
}

.play-pause .button-top {
    background: linear-gradient(#ffc31f, #ff9900);
    height: 8px;
}

.play-pause .button-bottom {
    height: 8px;
}

.play-pause:hover .button-label {
    color: #d60000;
    background: linear-gradient(#fff, #ffeb86 50%, #ffc31f);
}

/* --- Footer Note --- */
.footer-note {
    margin-top: 8px;
    padding: 6px 12px;
    background: #003c96;
    color: #ffc31f;
    border: 2px solid #003c96;
    box-shadow: 0 0 0 1px #fff inset;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* --- Responsive --- */
@media (max-width: 760px) {
    .page-shell {
        min-width: 0;
        max-width: 100%;
        padding: 5px;
    }

    .gallery-title {
        font-size: 22px;
    }

    .topline {
        font-size: 10px;
        gap: 8px;
    }

    .status-bar {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
    }

    .status-left,
    .status-right {
        gap: 8px;
    }

    .film-reel-frame {
        height: 60vh;
        min-height: 300px;
    }

    .control-bar {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .control-group {
        flex: 0 0 auto;
    }

    .retro-button {
        min-width: 80px;
    }

    .play-pause {
        min-width: 110px;
    }

    .button-label {
        font-size: 11px;
        padding: 4px 8px;
    }
}
