/* /dynamik-agri/demo: a desktop with the program open on it. Only what the site has no class
   for lives here - the desktop, the window chrome, the start-up screen and the taskbar. */

.demo-desktop {
    position: relative;
    height: min(78vh, 760px);
    min-height: 520px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-dark) url('../img/agri/demo-desktop.webp') center / cover no-repeat;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.demo-window {
    position: absolute;
    inset: 3.5% 4% 64px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.demo-desktop.is-ready .demo-window {
    opacity: 1;
    transform: none;
}

.demo-titlebar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 34px;
    padding: 0 var(--space-sm) 0 var(--space-md);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    user-select: none;
}

.demo-titlebar img {
    width: 16px;
    height: 16px;
}

.demo-titlebar-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-titlebar-controls {
    display: flex;
    gap: 2px;
}

.demo-titlebar-controls span {
    width: 34px;
    height: 24px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.demo-frame {
    flex: 1;
    width: 100%;
    border: 0;
    display: block;
    background: var(--color-surface);
}

.demo-boot {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: #0f2a1d;
    color: var(--color-text-inverse);
    transition: opacity 0.5s ease, visibility 0.5s;
    z-index: 2;
}

.demo-desktop.is-booted .demo-boot {
    opacity: 0;
    visibility: hidden;
}

.demo-boot img {
    width: 72px;
    height: 72px;
}

.demo-boot-text {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

.demo-boot-bar {
    width: 180px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.demo-boot-bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--color-accent-light);
    animation: demo-boot-slide 1.1s ease-in-out infinite;
}

@keyframes demo-boot-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

.demo-taskbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: rgba(20, 30, 25, 0.72);
    backdrop-filter: blur(12px);
}

.demo-taskbar-app {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
}

.demo-taskbar-app::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-accent-light);
}

.demo-taskbar-app img {
    width: 24px;
    height: 24px;
}

.demo-clock {
    position: absolute;
    right: var(--space-md);
    text-align: right;
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--color-text-inverse);
}

.demo-phone-note {
    display: none;
    margin: 0 0 var(--space-md);
    color: var(--color-text-secondary);
}

.demo-credit {
    margin: var(--space-sm) 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.demo-after {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

/* A phone has no desktop: the program fills the width, and the window chrome goes. */
@media (max-width: 767px) {
    .demo-desktop {
        height: 82vh;
        min-height: 480px;
        border-radius: var(--radius-md);
    }

    .demo-window {
        inset: 0;
        border-radius: 0;
    }

    .demo-titlebar,
    .demo-taskbar {
        display: none;
    }

    .demo-after {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-phone-note {
        display: block;
    }
}
