/* Custom styling, animations, and variables for Ospora */

html {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    background-color: #080C14;
}

body {
    background-color: #080C14;
    overflow-x: hidden;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
}

body.cabinet-route .cabinet-header {
    display: flex !important;
}

#screen-splash {
    min-height: 100%;
}

/* Custom fonts styling override */
h1, h2, h3, h4, .font-golos {
    font-family: 'Golos Text', 'Inter', sans-serif;
    letter-spacing: 0;
}

#page-shell {
    min-height: 100svh;
    background-color: #080C14;
}

#product-details {
    scroll-margin-top: 1rem;
}

.road-sign {
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    object-fit: contain;
    filter: drop-shadow(0 0.25rem 0.5rem rgba(0, 0, 0, 0.35));
}

.road-sign--round {
    border-radius: 50%;
}

.road-sign--square {
    border-radius: 0.2rem;
}

.demo-case {
    min-height: 4.25rem;
}

.demo-case:focus-visible {
    outline: 2px solid #60A5FA;
    outline-offset: 2px;
}

/* Animations */
@keyframes scan {
    0% {
        top: 0%;
        opacity: 0.8;
    }
    50% {
        top: 100%;
        opacity: 1;
    }
    100% {
        top: 0%;
        opacity: 0.8;
    }
}

.animate-scan {
    animation: scan 3s infinite linear;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 8s infinite ease-in-out;
}

/* Application ticker */
.application-ticker {
    align-items: center;
    min-height: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(17, 24, 39, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.application-ticker--desktop {
    border-radius: 9999px;
    padding: 0 0.875rem;
}

.application-ticker--mobile {
    display: flex;
    border-radius: 0.875rem;
    padding: 0 0.75rem;
}

.ticker-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ticker-track {
    display: flex;
    width: max-content;
    align-items: center;
    animation: ticker-scroll var(--ticker-duration, 28s) linear infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.ticker-group {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    padding-right: 1.25rem;
    flex: 0 0 auto;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    color: #D1D5DB;
    font-size: 0.6875rem;
    font-weight: 700;
}

.ticker-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: #3B82F6;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.12);
    flex: 0 0 auto;
}

.ticker-item--won .ticker-dot,
.ticker-item--document_generated .ticker-dot {
    background: #10B981;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.12);
}

@keyframes ticker-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(-1 * var(--ticker-distance, 50%)), 0, 0);
    }
}

.mobile-bottom-dock {
    background: linear-gradient(to top, #080C14 78%, rgba(8, 12, 20, 0));
    transition: opacity 240ms ease, transform 240ms ease;
}

.mobile-bottom-dock.is-scroll-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(1rem);
}

/* View transitions fallbacks & custom morph effects */
.active-view {
    display: flex !important;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Soft Edge Fade Content Masking for scrollable lists */
.soft-fade-mask {
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* Custom Scrollbar for premium feeling */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #1F2937;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3B82F6;
}

/* Glassmorphism components */
.glass-panel {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hide scrollbar utility for cleaner viewports */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

@media (max-width: 1023px) {
    #page-shell,
    #app-container,
    #device-shell,
    #app-screen {
        height: 100svh;
        min-height: 100svh;
    }

    #screen-splash {
        position: fixed;
        min-height: 100svh;
        width: 100%;
        max-width: 100%;
    }

    #app-body {
        height: 100%;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
    }

    #upload-card {
        aspect-ratio: auto;
        height: clamp(13.5rem, 30svh, 18rem);
        min-height: 13.5rem;
        flex: 0 0 auto;
    }

    .application-ticker--mobile {
        position: relative;
        z-index: 1;
        flex: 0 0 auto;
    }

    .mobile-bottom-dock {
        position: fixed;
        right: 0;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
        left: 0;
        z-index: 40;
        margin: 0;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 1023px) and (max-height: 880px) {
    #upload-card {
        height: 12.25rem;
        min-height: 12.25rem;
    }
}

@media (min-width: 1024px) {
    #page-shell {
        box-sizing: border-box;
        height: 100svh;
        min-height: 42.5rem;
        padding: 1.5rem clamp(2rem, 4vw, 4rem);
    }

    #page-layout {
        height: calc(100svh - 3rem);
        min-height: 0;
    }

    #desktop-landing {
        max-height: 100%;
    }

    #app-container {
        height: 100%;
        min-height: 0;
    }

    #device-shell {
        width: auto;
        height: min(56.25rem, 100%);
        max-width: 27.5rem;
        min-height: 0;
        flex: 0 0 auto;
        aspect-ratio: 10.9 / 19.5;
    }

    .application-ticker--mobile {
        display: none;
    }

    .mobile-bottom-dock {
        background: none;
    }
}

@media (min-width: 1024px) and (max-height: 900px) {
    #app-body[data-state="state-upload"] {
        overflow-y: hidden;
        padding: 0.5rem 1rem 0.75rem;
    }

    .upload-header {
        margin-bottom: 0.75rem;
    }

    .upload-intro {
        margin-bottom: 0.75rem;
    }

    .upload-intro h3 {
        font-size: 1.0625rem;
    }

    .upload-intro p {
        font-size: 0.6875rem;
        line-height: 1.45;
    }

    #upload-card {
        aspect-ratio: auto;
        height: clamp(9.5rem, 24vh, 11.5rem);
        min-height: 0;
        margin-bottom: 0.75rem;
        padding: 1rem;
        flex: 0 0 auto;
    }

    .upload-separator {
        margin-bottom: 0.75rem;
    }

    .upload-demos {
        margin-bottom: 0.5rem;
    }

    .upload-demos > * + * {
        margin-top: 0.5rem !important;
    }

    .demo-case {
        min-height: 3.5rem;
        padding: 0.625rem;
    }

    .road-sign {
        width: 2.25rem;
        height: 2.25rem;
        flex-basis: 2.25rem;
    }

    .mobile-bottom-dock {
        margin-top: auto;
    }

    .mobile-bottom-dock > div {
        padding-top: 0.625rem;
    }

    #desktop-landing {
        padding-right: 1.5rem;
    }

    .hero-kicker,
    .hero-ticker {
        margin-bottom: 0.75rem;
    }

    .hero-title {
        margin-bottom: 0.875rem;
        font-size: clamp(2.75rem, 7vh, 3.5rem);
        line-height: 1;
    }

    .hero-copy {
        margin-bottom: 1rem;
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .hero-steps {
        margin-bottom: 1rem;
    }

    .hero-steps > * + * {
        margin-top: 0.75rem !important;
    }

    .hero-step {
        gap: 0.75rem;
    }

    .hero-step-index {
        width: 2.25rem;
        height: 2.25rem;
        flex: 0 0 2.25rem;
    }

    .hero-step h3 {
        font-size: 0.9375rem;
    }

    .hero-step p {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .hero-stats {
        padding-top: 1rem;
    }

    .hero-stats > div > div:first-child {
        font-size: 1.45rem;
    }
}

@media (min-width: 1280px) and (max-height: 900px) {
    #desktop-landing {
        padding-left: clamp(2rem, 4vw, 4rem);
    }
}
