/* Netto Font Face Declarations */
@font-face {
    font-family: 'Netto';
    src: url('assets/font/NettoWeb.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Netto';
    src: url('assets/font/NettoWeb-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Netto';
    src: url('assets/font/NettoWeb-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #000;
    min-height: 100vh;
    color: #333;
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.loading-screen__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.loading-screen__logo img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.loading-screen__skip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 30px;
    color: white;
    font-size: 18px;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.loading-screen__skip:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Onboarding Styles - Matching Figma Design */
.onboarding {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    overflow: hidden;
}

/* Header */
.onboarding__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: max(2vh, 20px) max(3vw, 20px) 0;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.onboarding__logo {
    color: white;
}

.onboarding__logo-title {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(20px, 3.5vh, 38px);
    font-weight: 400;
    letter-spacing: 1.654px;
    line-height: 1.2;
    margin: 0;
    color: white;
}

.onboarding__logo-space {
    letter-spacing: 5.2936px;
}

.container__logo-space {
    letter-spacing: 5.2936px;
}

.onboarding__logo-subtitle {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(14px, 2.2vh, 25px);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0;
    margin-top: clamp(-8px, -0.5vh, 0px);
    color: white;
}

.onboarding__more-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 30px;
    color: white;
    padding: clamp(8px, 1vh, 12px) clamp(16px, 2vw, 24px);
    font-size: clamp(14px, 1.8vh, 18px);
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.onboarding__more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.onboarding__more-btn:focus {
    outline: none;
}

.onboarding__more-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Main Content */
.onboarding__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 3vh, 40px) 5vw clamp(20px, 2vh, 40px);
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.onboarding__image-container {
    /* Breite basiert auf Höhe UND max-width, um Seitenverhältnis zu erhalten - identisch mit Scanner */
    width: min(90vw, 1000px, calc((100vh - 350px) * 900 / 675));
    width: min(90vw, 1000px, calc((100dvh - 350px) * 900 / 675));
    max-width: min(90vw, 1000px);
    max-height: calc(100vh - 350px);
    max-height: calc(100dvh - 350px);
    aspect-ratio: 900 / 675;
    background: #000;
    border: 1px solid #5c5c5c;
    border-radius: clamp(15px, 2vw, 20px);
    overflow: hidden;
    margin: clamp(20px, 3vh, 40px) auto clamp(15px, 2vh, 20px);
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1920px) {
    .onboarding__image-container {
        max-width: 1200px;
    }
}

/* Responsive Größen für kleinere Bildschirme - Seitenverhältnis beibehalten */
@media (max-height: 700px) {
    .onboarding__image-container {
        width: min(90vw, 1000px, calc((100vh - 300px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 300px) * 900 / 675));
    }
}

@media (max-height: 600px) {
    .onboarding__image-container {
        width: min(90vw, 1000px, calc((100vh - 260px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 260px) * 900 / 675));
    }
}

.onboarding__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 0;
}

.onboarding__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.6) 85%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: clamp(15px, 2vw, 20px);
}

.onboarding__text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: clamp(20px, 3vh, 40px) clamp(20px, 3vw, 40px) clamp(20px, 2.5vh, 35px);
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
    width: 100%;
}

.onboarding__description {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(14px, 1.8vh, 18px);
    font-weight: 400;
    line-height: 1.6;
    color: white;
    margin: 0;
    text-align: left;
    pointer-events: auto;
}

.onboarding__description--bold {
    font-weight: 700;
}

.onboarding__description--highlight {
    color: #0091d1;
}

.onboarding__start-btn {
    background: #0091d1;
    border: 3px solid #0091d1;
    border-radius: 30px;
    color: white;
    padding: 14px 56px;
    font-size: 18px;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    flex-shrink: 0;
    min-width: 280px;
    text-align: center;
    display: block;
}

.onboarding__start-btn:hover {
    background: #007bb3;
    border-color: #007bb3;
    transform: translateY(-1px);
}

.onboarding__status {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #878787;
    margin: 10px auto 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Footer */
.onboarding__footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 0 max(3vw, 20px) max(2vh, 20px);
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.onboarding__footer-link {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #878787;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    transition: color 0.2s ease;
}

.onboarding__footer-separator {
    color: #878787;
    margin: 0 10px;
}

.onboarding__footer-link:hover {
    color: #b0b0b0;
    text-decoration: underline;
}

/* Hide onboarding when completed */
.onboarding--hidden {
    display: none;
}

/* Scanner App Container */
.container {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    width: 100%;
    z-index: 10000;
}

/* Scanner App Header */
.container > h1 {
    display: none;
}

.container__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 30px 53px 80px 53px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
    flex-shrink: 0;
    pointer-events: none;
    /* Sanfter, eleganter Fade von oben nach unten */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.8) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.1) 85%,
        rgba(0, 0, 0, 0) 100%
    );
}

.container__header > * {
    pointer-events: auto;
}

.container__logo {
    color: white;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.container__logo:hover {
    opacity: 0.8;
}

.container__logo-title {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 1.654px;
    line-height: 1.2;
    margin: 0;
    color: white;
}

.container__logo-subtitle {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0;
    margin-top: -4px;
    color: white;
}

.container__more-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 30px;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.container__more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.container__more-btn:focus {
    outline: none;
}

.container__more-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.container__footer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    padding: 80px 20px 20px;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
    /* Sanfter, eleganter Fade von unten nach oben */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.8) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.1) 85%,
        rgba(0, 0, 0, 0) 100%
    );
}

.container__footer > * {
    pointer-events: auto;
}

.container__footer-link {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #878787;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    transition: color 0.2s ease;
}

.container__footer-separator {
    color: #878787;
    margin: 0 10px;
}

.container__footer-link:hover {
    color: #b0b0b0;
    text-decoration: underline;
}

/* Main Content Area - ensures scanner + button are always visible */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#scanner-container {
    /* Breite basiert auf Höhe UND max-width, um Seitenverhältnis zu erhalten */
    width: min(90vw, 1000px, calc((100vh - 350px) * 900 / 675));
    width: min(90vw, 1000px, calc((100dvh - 350px) * 900 / 675));
    max-width: min(90vw, 1000px);
    aspect-ratio: 900 / 675;
    background: #000;
    border: 1px solid #5c5c5c;
    border-radius: clamp(15px, 2vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: clamp(20px, 3vh, 40px) auto clamp(15px, 2vh, 20px);
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 1920px) {
    #scanner-container {
        max-width: 1200px;
    }
}

/* Responsive Größen für kleinere Bildschirme - Seitenverhältnis beibehalten */
@media (max-height: 700px) {
    #scanner-container {
        width: min(90vw, 1000px, calc((100vh - 300px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 300px) * 900 / 675));
    }
}

@media (max-height: 600px) {
    #scanner-container {
        width: min(90vw, 1000px, calc((100vh - 260px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 260px) * 900 / 675));
    }
}

/* About Container - scrollable content area */
.about-container {
    width: 100%;
    max-width: min(90vw, 1000px);
    /* Maximale Höhe für Scrollbarkeit - Viewport minus Header und Footer */
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    background: transparent;
    border: none;
    position: relative;
    margin: 0 auto;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.about-container__close-btn {
    display: none;
}

/* Scrollbar styling for about container - versteckt und nur sichtbar bei Hover */
.about-container {
    /* Firefox */
    scrollbar-width: none; /* Versteckt die Scrollbar in Firefox */
    -webkit-overflow-scrolling: touch;
}

.about-container:hover {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* WebKit (Chrome, Safari, Edge) */
.about-container::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.about-container:hover::-webkit-scrollbar {
    width: 6px;
}

.about-container::-webkit-scrollbar-track {
    background: transparent;
}

.about-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.about-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

@media (min-width: 1920px) {
    .about-container {
        max-width: 1200px;
    }
}

/* Responsive max-height für About Container auf kleineren Bildschirmen */
@media (max-height: 700px) {
    .about-container {
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
    }
}

@media (max-height: 600px) {
    .about-container {
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
    }
}

/* Video Container - same size as scanner container */
.video-container {
    /* Breite basiert auf Höhe UND max-width, um Seitenverhältnis zu erhalten */
    width: min(90vw, 1000px, calc((100vh - 350px) * 900 / 675));
    width: min(90vw, 1000px, calc((100dvh - 350px) * 900 / 675));
    max-width: min(90vw, 1000px);
    aspect-ratio: 900 / 675;
    background: #000;
    border: 1px solid #5c5c5c;
    border-radius: clamp(15px, 2vw, 20px);
    position: relative;
    margin: clamp(20px, 3vh, 40px) auto clamp(15px, 2vh, 20px);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 1;
    min-height: 0;
}

@media (min-width: 1920px) {
    .video-container {
        max-width: 1200px;
    }
}

/* Responsive Größen für Video-Container - Seitenverhältnis beibehalten */
@media (max-height: 700px) {
    .video-container {
        width: min(90vw, 1000px, calc((100vh - 300px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 300px) * 900 / 675));
    }
}

@media (max-height: 600px) {
    .video-container {
        width: min(90vw, 1000px, calc((100vh - 260px) * 900 / 675));
        width: min(90vw, 1000px, calc((100dvh - 260px) * 900 / 675));
    }
}


.video-container__player-wrapper {
    flex: 1 1 100%;
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-container__player,
#video-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}


.video-container__back-btn:hover {
    background: #007bb3;
    border-color: #007bb3;
    transform: translateY(-1px);
}

/* Cinema Mode - dims UI elements during video playback (75% = opacity 0.25) */
.cinema-mode.cinema-dimmed .container__header,
.cinema-mode.cinema-dimmed .container__footer,
.cinema-mode.cinema-dimmed .video-container__back-btn,
.cinema-mode.cinema-dimmed #result {
    opacity: 0.25;
    transition: opacity 0.5s ease;
}

.cinema-mode.cinema-dimmed .video-container {
    border-color: rgba(92, 92, 92, 0.25);
    transition: border-color 0.5s ease;
}

.cinema-mode .container__header,
.cinema-mode .container__footer,
.cinema-mode .video-container__back-btn,
.cinema-mode #result {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.cinema-mode .video-container {
    border-color: #5c5c5c;
    transition: border-color 0.3s ease;
}

.about-container__content {
    width: 100%;
    padding: 30px 20px 20px;
    box-sizing: border-box;
}

.about-container__tags-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto 15px;
    border-radius: 10px;
    overflow: hidden;
}

.about-container__tags-image img {
    width: 100%;
    height: auto;
    max-height: 320px;
    display: block;
    object-fit: cover;
}

.about-container__section {
    width: 100%;
    margin: 0 auto 15px;
    color: white;
}

.about-container__heading {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: white;
    margin: 0 0 12px;
    letter-spacing: normal;
}

.about-container__text-block {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: white;
    letter-spacing: -0.2px;
    margin: 0 0 12px;
}

.about-container__text-block p {
    margin: 0 0 10px;
    max-width: 800px;
}

.about-container__text-bold {
    font-weight: 700;
}

.about-container__section p {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: white;
    letter-spacing: -0.2px;
    margin: 0 0 12px;
    max-width: 800px;
}

.about-container__images-row {
    display: flex;
    gap: 10px;
    margin: 0 auto 15px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
}

.about-container__image-item {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.about-container__image-item img {
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    object-fit: cover;
}

.about-container__horizontal-scroll {
    width: 100%;
    margin: 0 auto 15px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.about-container__horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.about-container__horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.about-container__horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.about-container__horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.about-container__scroll-content {
    display: flex;
    gap: max(1vw, 10px);
    padding-bottom: 8px;
    width: 2000px;
    height: 268px;
}

.about-container__scroll-item {
    flex-shrink: 0;
    width: 400px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-container__scroll-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.about-container__large-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    margin: 0 auto;
}

.about-container__large-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.about-container__footer {
    width: 100%;
    margin: 15px auto 0;
    padding-top: 10px;
}

.about-container__copyright {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: white;
    letter-spacing: -0.2px;
    margin: 0;
}

/* Mobile optimizations for About container */
@media (max-width: 768px) {
    .about-container {
        max-width: 100%;
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
    }
    
    .about-container__content {
        padding: clamp(100px, 10vh, 120px) 15px clamp(100px, 10vh, 120px);
    }
    
    .about-container__images-row {
        flex-wrap: wrap;
        flex-direction: row;
    }

    .about-container__image-item {
        min-width: calc(50% - 5px);
        flex: 0 0 calc(50% - 5px);
    }

    .about-container__scroll-item {
        width: min(180px, 40vw);
    }
}

@media (max-width: 480px) {
    .about-container__content {
        padding: clamp(100px, 10vh, 120px) 15px clamp(100px, 10vh, 120px);
    }
    
    .about-container__scroll-item {
        width: min(300px, 70vw);
    }
}

#result {
    font-size: 14px;
    color: #878787;
    text-align: center;
    margin: 10px auto 20px;
    padding: 0;
    background: transparent;
    border: none;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    flex-shrink: 0;
}

button {
    font-family: inherit;
    outline: none;
}

button:focus {
    outline: none;
}

.error-message {
    color: #dc3545;
    font-weight: 600;
}

/* Unified button styles for scanner buttons */
#start-scan,
#new-scan,
.video-container__back-btn {
    display: block;
    margin: 20px auto 0;
    padding: 14px 56px;
    font-size: 18px;
    background: #0091d1;
    border: 3px solid #0091d1;
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    flex-shrink: 0;
    min-width: 280px;
    text-align: center;
}

#start-scan:hover,
#new-scan:hover {
    background: #007bb3;
    border-color: #007bb3;
    transform: translateY(-1px);
}

#start-scan:disabled {
    background: rgba(0, 145, 209, 0.4);
    border-color: rgba(0, 145, 209, 0.5);
    cursor: not-allowed;
    transform: none;
}

#start-scan.scan-running {
    background: rgba(0, 145, 209, 0.4);
    border-color: rgba(0, 145, 209, 0.5);
}

#new-scan {
    display: none;
}

.flashlight-button {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.flashlight-button__icon {
    width: 22px;
    height: 22px;
}

.flashlight-button.flashlight-button--visible {
    display: flex;
}

.flashlight-button.flashlight-button--active {
    background: #0091d1;
    border-color: #0091d1;
}

/* Only apply hover on devices with mouse (not touch) */
@media (hover: hover) {
    .flashlight-button:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .flashlight-button.flashlight-button--active:hover {
        background: #007bb3;
        border-color: #007bb3;
    }
}

.flashlight-button:focus-visible {
    outline: 2px solid #0091d1;
    outline-offset: 2px;
}

.status {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    color: #878787;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom Scanner Loading Indicator */
#custom-scanner-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.custom-loader__text {
    color: #878787;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(16px, 2vh, 24px);
    margin-bottom: 20px;
}

.custom-loader__bar {
    width: 300px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
}

.custom-loader__progress {
    width: 30%;
    height: 100%;
    background: #0091d1;
    border-radius: 4px;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0% {
        width: 10%;
        margin-left: 0;
    }
    50% {
        width: 40%;
        margin-left: 30%;
    }
    100% {
        width: 10%;
        margin-left: 90%;
    }
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

canvas {
    display: none;
}

.result-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(40, 167, 69, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(40, 167, 69, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}

.result-popup--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.modal-open {
    overflow: hidden;
}

.video-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
}

.video-modal--visible {
    opacity: 1;
    transform: scale(1);
}

.video-modal__content {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
    width: 100%;
    max-width: min(90vw, 1000px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
}

@media (min-width: 1920px) {
    .video-modal__content {
        max-width: 1200px;
    }
}

.video-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.04);
}

.video-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.video-modal__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.video-modal__close:hover {
    color: #f87171;
    transform: scale(1.1);
}

.video-modal__body {
    background: #000;
}

.video-modal__player {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 900 / 675;
    overflow: hidden;
}

.video-modal__body video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    display: block;
    background: #000;
}

.video-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    background: rgba(255, 255, 255, 0.04);
}

.video-modal__back {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.35);
}

.video-modal__back:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(249, 115, 22, 0.45);
}

.video-modal__close:focus,
.video-modal__back:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container__header {
        flex-wrap: wrap;
        gap: 15px;
        padding: max(2vh, 20px) 5vw max(2vh, 20px);
    }

    #start-scan,
    #new-scan,
    .video-container__back-btn,
    .onboarding__start-btn {
        padding: clamp(10px, 1.2vh, 14px) clamp(36px, 4vw, 48px);
        font-size: clamp(14px, 1.8vh, 18px);
        min-width: 240px;
    }

    .flashlight-button.flashlight-button--visible {
        display: flex;
    }

    #result {
        font-size: 1rem;
        padding: 15px;
    }

    /* Onboarding mobile styles */
    .onboarding__header {
        flex-wrap: wrap;
        gap: 15px;
        padding: max(2vh, 20px) 5vw 0;
    }

    .onboarding__main {
        padding: clamp(20px, 3vh, 40px) 5vw clamp(20px, 2vh, 40px);
    }

    .loading-screen__skip {
        bottom: 30px;
        font-size: 16px;
        padding: 10px 24px;
    }

    .modal {
        border-radius: 16px;
    }

    .modal-video-wrapper {
        padding: 0 16px 16px;
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    #scanner-container {
        width: min(90vw, calc((100vh - 320px) * 900 / 675));
        width: min(90vw, calc((100dvh - 320px) * 900 / 675));
        max-width: 90vw;
        aspect-ratio: 900 / 675;
        background: #000;
        margin: clamp(20px, 3vh, 30px) auto clamp(20px, 3vh, 30px);
    }
    
    .video-container {
        width: min(90vw, calc((100vh - 320px) * 900 / 675));
        width: min(90vw, calc((100dvh - 320px) * 900 / 675));
        max-width: 90vw;
        aspect-ratio: 900 / 675;
        margin: clamp(20px, 3vh, 30px) auto clamp(20px, 3vh, 30px);
    }
    
    .main-content {
        padding: clamp(120px, 12vh, 140px) max(3vw, 15px) clamp(120px, 12vh, 140px) !important;
    }

    .onboarding__header {
        padding: 15px 5vw 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .onboarding__more-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .onboarding__main {
        padding: clamp(20px, 3vh, 40px) 5vw clamp(20px, 2vh, 40px);
    }
    
    .onboarding__image-container {
        width: min(90vw, calc((100vh - 280px) * 900 / 675));
        width: min(90vw, calc((100dvh - 280px) * 900 / 675));
        max-width: 90vw;
        margin: clamp(20px, 3vh, 30px) auto clamp(15px, 2vh, 20px);
    }
    
    .onboarding__text {
        padding: 15px;
    }

    .onboarding__description {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .onboarding__start-btn {
        width: 100%;
        min-width: unset;
        max-width: 100%;
        padding: 12px 24px;
        font-size: 16px;
        box-sizing: border-box;
        margin: 20px auto 0;
    }
    
    .onboarding__status {
        font-size: 13px;
        margin: 10px auto 15px;
    }
    
    .onboarding__footer {
        padding: 0 5vw 20px;
    }
    
    .onboarding__footer-link {
        font-size: 13px;
    }

    .onboarding__icon--large {
        font-size: 4rem;
    }
    
    /* Scanner screen mobile */
    .container__header {
        padding: 15px 5vw 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .container__more-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    #start-scan,
    #new-scan,
    .video-container__back-btn {
        width: 100%;
        min-width: unset;
        max-width: 100%;
        padding: 12px 24px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    #result {
        font-size: 13px;
    }
    
    .container__footer {
        padding: 0 5vw 20px;
    }
    
    .container__footer-link {
        font-size: 13px;
    }
    
    .video-container {
        max-width: 100%;
    }
    
    #scanner-container {
        max-width: 90vw;
    }
    
    .video-container {
        max-width: 90vw;
    }
}

/* About Moving Types Page Styles */
.about-page {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.about-page__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: max(2vh, 20px) max(3vw, 20px) 0;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.about-page__logo {
    color: white;
}

.about-page__logo-title {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(20px, 3.5vh, 38px);
    font-weight: 400;
    letter-spacing: 1.654px;
    line-height: 1.2;
    margin: 0;
    color: white;
}

.about-page__logo-space {
    letter-spacing: 5.2936px;
}

.about-page__logo-subtitle {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(14px, 2.2vh, 25px);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0;
    margin-top: clamp(-8px, -0.5vh, 0px);
    color: white;
}

.about-page__close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 50%;
    color: white;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.about-page__close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.about-page__content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.about-page__tags-image {
    width: 100%;
    max-width: 855px;
    height: auto;
    margin: 0 auto max(3vh, 30px);
    border: 1px solid #5c5c5c;
    border-radius: 20px;
    overflow: hidden;
}

.about-page__tags-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.about-page__section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto max(3vh, 30px);
    color: white;
}

.about-page__heading {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: white;
    margin: 0 0 max(2vh, 20px);
    letter-spacing: normal;
}

.about-page__text-block {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    color: white;
    letter-spacing: -0.288px;
    margin: 0 0 max(2vh, 20px);
}

.about-page__text-block p {
    margin: 0 0 max(1.5vh, 15px);
    max-width: 800px;
}

.about-page__text-bold {
    font-weight: 700;
}

.about-page__section p {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    color: white;
    letter-spacing: -0.288px;
    margin: 0 0 max(2vh, 20px);
    max-width: 800px;
}

.about-page__images-row {
    display: flex;
    gap: max(2vw, 20px);
    margin: 0 auto max(3vh, 30px);
    max-width: 900px;
    flex-wrap: wrap;
}

.about-page__image-item {
    flex: 1;
    min-width: min(400px, 100%);
    border: 1px solid #5c5c5c;
    border-radius: 20px;
    overflow: hidden;
}

.about-page__image-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.about-page__horizontal-scroll {
    width: 100%;
    max-width: 900px;
    margin: 0 auto max(3vh, 30px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.about-page__horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.about-page__horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.about-page__horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.about-page__horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.about-page__scroll-content {
    display: flex;
    gap: max(2vw, 20px);
    padding-bottom: 10px;
    width: max-content;
}

.about-page__scroll-item {
    flex-shrink: 0;
    width: 400px;
    border: 1px solid #5c5c5c;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-page__scroll-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.about-page__large-image {
    width: 100%;
    max-width: 846px;
    height: auto;
    border: 1px solid #5c5c5c;
    border-radius: 20px;
    overflow: hidden;
    display: block;
    margin: 0 auto;
}

.about-page__large-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.about-page__footer {
    width: 100%;
    max-width: 900px;
    margin: max(4vh, 40px) auto 0;
    padding-top: max(2vh, 20px);
}

.about-page__copyright {
    font-family: 'Netto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    color: white;
    letter-spacing: -0.288px;
    margin: 0;
}

/* Mobile optimizations for About page */
@media (max-width: 768px) {
    .about-page__header {
        flex-wrap: wrap;
        gap: 15px;
    }

    .about-page__content {
        padding: max(12vh, 120px) max(2vw, 15px) max(12vh, 120px);
    }

    .about-page__images-row {
        flex-direction: column;
    }

    .about-page__image-item {
        min-width: 100%;
    }

    .about-page__scroll-item {
        width: min(400px, 90vw);
    }

    .about-page__section p,
    .about-page__text-block {
        font-size: 16px;
        line-height: 20px;
    }
}

@media (max-width: 480px) {
    .about-page__heading {
        font-size: 18px;
    }

    .about-page__section p,
    .about-page__text-block {
        font-size: 14px;
        line-height: 18px;
    }

    .about-page__scroll-item {
        width: min(300px, 70vw);
    }
    
    .about-page__content {
        padding: max(12vh, 120px) max(2vw, 15px) max(12vh, 120px);
    }
}
