/* =========================================================================
   /razvoj-aplikacij/ in /en/app-development/: posebnosti na skupnem sistemu
   produktna-stran.css. Osrednji trenutek: ob drsenju se razmetani deli
   (tabela, e-pošta, listek) zlijejo v eno aplikacijo. --p teče od 0 do 1 in
   ga nastavlja produktna-stran.js na .ws-stage; podedujejo ga vsi otroci.
   ========================================================================= */

/* ------------------------------------------------------------- Scena */
.ap-stage { height: 460vh; }
.ap-scene { width: min(1100px, 94vw, calc((100vh - 300px) * 1.6)); margin: 0; }
.ap-scene-caption { display: grid; margin-bottom: 28px; text-align: center; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 600; letter-spacing: -0.025em; }
.ap-scene-caption > span { grid-area: 1 / 1; }
.ap-cap-before { color: var(--ws-muted-dark); opacity: clamp(0, calc(1 - var(--p) * 2.5), 1); }
.ap-cap-after { color: #f5f5f7; opacity: 0; transition: opacity 0.45s var(--ws-ease); }
.ws-stage[data-screen="0"] .ap-cap-0, .ws-stage[data-screen="1"] .ap-cap-1,
.ws-stage[data-screen="2"] .ap-cap-2, .ws-stage[data-screen="3"] .ap-cap-3 { opacity: clamp(0, calc((var(--p) - 0.55) * 2.5), 1); }

.ap-canvas { position: relative; aspect-ratio: 16 / 9.4; container-type: inline-size; }

/* Razmetani deli: začnejo raztreseni in se ob drsenju zbližajo v središče */
.ap-frag {
    --x: 0cqw; --y: 0cqw; --r: 0deg;
    position: absolute; left: 50%; top: 50%; width: 34cqw; z-index: 2;
    border-radius: 1cqw; overflow: hidden; background: #fff;
    box-shadow: 0 2cqw 5cqw -1cqw rgba(0, 0, 0, 0.55);
    font: 500 1.15cqw/1.3 var(--ws-font); color: #1d1d1f;
    transform: translate(-50%, -50%) translate(calc(var(--x) * (1 - var(--p))), calc(var(--y) * (1 - var(--p)))) rotate(calc(var(--r) * (1 - var(--p)))) scale(calc(1 - 0.55 * var(--p)));
    opacity: clamp(0, calc(1.2 - var(--p) * 2), 1);
    will-change: transform, opacity;
}
.ap-frag-sheet { --x: -33cqw; --y: -9cqw; --r: -5deg; }
.ap-frag-mail { --x: 33cqw; --y: -12cqw; --r: 4deg; width: 30cqw; }
.ap-frag-note { --x: 20cqw; --y: 17cqw; --r: -4deg; width: 20cqw; padding: 1.6cqw; background: #ffe680; }
.ap-frag-bar { display: flex; align-items: center; gap: 0.8cqw; padding: 0.9cqw 1.2cqw; background: #f1f1f3; font-size: 1cqw; color: #6e6e73; }
.ap-frag-bar i { width: 1.2cqw; height: 1.2cqw; border-radius: 0.3cqw; background: #1f8f4e; }
.ap-frag-mail .ap-frag-bar i { background: var(--ws-blue); border-radius: 50%; }
.ap-sheet { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.ap-sheet span { height: 2.6cqw; border-right: 1px solid #e3e3e8; border-bottom: 1px solid #e3e3e8; background: linear-gradient(#d2d2d7, #d2d2d7) 0.8cqw 50% / 55% 0.5cqw no-repeat; }
.ap-sheet span:nth-child(4n) { background-size: 30% 0.5cqw; }
.ap-sheet span:nth-child(-n+4) { background-color: #f5f5f7; background-image: linear-gradient(#86868b, #86868b); }
.ap-sheet span:nth-child(7), .ap-sheet span:nth-child(14) { background-color: #ffd7d7; }
.ap-mail { margin: 0; padding: 0.4cqw 0; list-style: none; }
.ap-mail li { display: flex; align-items: center; gap: 1cqw; padding: 1cqw 1.4cqw; border-bottom: 1px solid #ececf0; }
.ap-mail b { flex: none; width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--ws-blue); }
.ap-mail li:nth-child(n+3) b { background: transparent; }
.ap-frag-note p { margin: 0 0 1cqw; font-size: 1.35cqw; font-weight: 600; line-height: 1.25; }
.ap-frag-note span { display: block; height: 0.45cqw; margin-top: 0.9cqw; border-radius: 1cqw; background: rgba(0, 0, 0, 0.14); }
.ap-frag-note span:last-child { width: 60%; }

/* Aplikacija: izhaja iz sredine in prevzame celoten okvir */
.ap-app {
    position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
    border-radius: 1.6cqw; overflow: hidden; background: #fff;
    font: 500 1.1cqw/1.3 var(--ws-font); color: #1d1d1f; letter-spacing: -0.01em; text-align: left;
    transform: scale(calc(0.8 + 0.2 * var(--p)));
    opacity: clamp(0, calc((var(--p) - 0.2) * 2.5), 1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 3cqw 9cqw -2cqw rgba(79, 134, 247, 0.4);
    will-change: transform, opacity;
}
.ap-app-bar { display: flex; gap: 0.6cqw; padding: 1cqw 1.4cqw; background: #f1f1f3; border-bottom: 1px solid #e5e5ea; }
.ap-app-bar i { width: 1cqw; height: 1cqw; border-radius: 50%; background: #d4d4d8; }
.ap-app-body { flex: 1; display: grid; grid-template-columns: 17cqw 1fr; min-height: 0; }
.ap-app-side { display: flex; flex-direction: column; gap: 0.4cqw; padding: 2cqw 1.4cqw; background: #f7f7f9; border-right: 1px solid #ececf0; }
.ap-app-side span { padding: 0.8cqw 1.1cqw; border-radius: 0.7cqw; color: #6e6e73; }
.ap-app-side span { transition: background-color 0.35s, color 0.35s, box-shadow 0.35s; }
.ws-stage[data-screen="0"] .ap-nav-0, .ws-stage[data-screen="1"] .ap-nav-1,
.ws-stage[data-screen="2"] .ap-nav-2, .ws-stage[data-screen="3"] .ap-nav-4 { background: #fff; color: var(--ws-blue); box-shadow: 0 0.1cqw 0.4cqw rgba(0, 0, 0, 0.08); }
.ap-app-main { position: relative; min-width: 0; overflow: hidden; }
/* Zasloni: viden je tisti, ki ga določa data-screen na odru */
.ap-screen {
    position: absolute; inset: 2.2cqw 2.6cqw; display: flex; flex-direction: column; gap: 1.8cqw;
    opacity: 0; transform: translateY(1.5cqw); visibility: hidden;
    transition: opacity 0.5s var(--ws-ease), transform 0.6s var(--ws-ease), visibility 0s 0.6s;
}
.ws-stage[data-screen="0"] .ap-screen-0, .ws-stage[data-screen="1"] .ap-screen-1,
.ws-stage[data-screen="2"] .ap-screen-2, .ws-stage[data-screen="3"] .ap-screen-3 { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.ap-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; }
.ap-search { width: 24cqw; padding: 0.8cqw 1.4cqw; border-radius: 2cqw; background: #f2f2f5; color: #8e8e93; }
.ap-sub { color: #6e6e73; }
.ap-export { padding: 0.8cqw 1.6cqw; border-radius: 2cqw; background: var(--ws-blue); color: #fff; font-weight: 600; }
.ap-list { align-self: stretch; border: 1px solid #ececf0; border-radius: 1.1cqw; overflow: hidden; }
.ap-list-head, .ap-list-row { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 1fr; align-items: center; gap: 1cqw; padding: 0 1.6cqw; }
.ap-list-head { height: 3.2cqw; background: #f7f7f9; color: #8e8e93; font-size: 0.95cqw; }
.ap-list-row { height: 4.1cqw; border-top: 1px solid #f0f0f3; }
.ap-list-row span:first-child { display: flex; align-items: center; gap: 1cqw; font-weight: 600; }
.ap-list-row span:nth-child(2), .ap-list-row span:nth-child(3) { color: #6e6e73; }
.ap-avatar { display: grid; place-items: center; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: #e3edff; color: var(--ws-blue); font-size: 1cqw; }
.ap-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.ap-steps li { position: relative; padding-top: 1.8cqw; color: #8e8e93; font-weight: 600; }
.ap-steps li::before { content: ''; position: absolute; top: 0.45cqw; left: 0; right: 0; height: 0.3cqw; background: #e5e5ea; }
.ap-steps li::after { content: ''; position: absolute; top: 0; left: 0; width: 1.2cqw; height: 1.2cqw; border-radius: 50%; background: #e5e5ea; }
.ap-steps li.is-done { color: #1d1d1f; }
.ap-steps li.is-done::before, .ap-steps li.is-done::after { background: var(--ws-blue); }
.ap-steps li.is-now::before { background: linear-gradient(90deg, var(--ws-blue) 50%, #e5e5ea 50%); }
.ap-steps li.is-now::after { box-shadow: 0 0 0 0.5cqw rgba(35, 103, 245, 0.2); }
.ap-qty { color: #6e6e73; }
.ap-log { margin: 0; padding: 0; list-style: none; }
.ap-log li { display: grid; grid-template-columns: 7cqw 1fr; gap: 1cqw; padding: 0.75cqw 0; border-top: 1px solid #f0f0f3; }
.ap-log b { color: #8e8e93; font-weight: 600; }
.ap-log li.is-auto { margin-top: 0.4cqw; padding: 0.9cqw 1cqw; border: 0; border-radius: 0.8cqw; background: #e3edff; color: #1a55d6; }
.ap-log li.is-auto b { color: #1a55d6; }
.ap-report-chart { flex: 1; display: flex; flex-direction: column; }
.ap-report-chart .ap-bars { flex: 1; height: auto; }
.ap-bars-wide { gap: 0.8cqw; }
.ap-app-title { margin: 0; font-size: 2.2cqw; font-weight: 700; letter-spacing: -0.03em; }
.ap-app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqw; }
.ap-app-stats div { padding: 1.4cqw 1.6cqw; border-radius: 1.1cqw; background: #f5f5f7; }
.ap-app-stats span { display: block; color: #6e6e73; }
.ap-app-stats b { display: block; margin-top: 0.4cqw; font-size: 2.8cqw; font-weight: 700; letter-spacing: -0.04em; }
.ap-app-stats div:first-child b { color: var(--ws-blue); }
.ap-app-grid { flex: 1; display: grid; align-content: start; grid-template-columns: 1.3fr 1fr; gap: 1.4cqw; min-height: 0; }
.ap-app-table, .ap-app-chart { padding: 1.4cqw 1.6cqw; border: 1px solid #ececf0; border-radius: 1.1cqw; }
.ap-app-table p, .ap-app-chart p { margin: 0 0 1cqw; font-weight: 600; }
.ap-app-table div { display: flex; justify-content: space-between; align-items: center; padding: 0.75cqw 0; border-top: 1px solid #f0f0f3; }
.ap-pill { padding: 0.25cqw 0.9cqw; border-radius: 2cqw; font-style: normal; font-size: 0.95cqw; font-weight: 600; }
.ap-pill-wait { background: #fff4d6; color: #8a6100; }
.ap-pill-go { background: #e3edff; color: #1a55d6; }
.ap-pill-done { background: #e2f6e7; color: #1f7a3d; }
.ap-bars { display: flex; align-items: flex-end; gap: 1cqw; height: 15cqw; }
.ap-bars i { flex: 1; height: calc(var(--h) * (0.3 + 0.7 * var(--p))); border-radius: 0.5cqw 0.5cqw 0 0; background: linear-gradient(180deg, #6b9cff, #2367F5); }

/* ---------------------------------------------------------- Primeri */
.ap-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ap-case { display: flex; flex-direction: column; padding: 34px 30px 32px; border-radius: var(--ws-radius); background: var(--ws-coal); }
.ap-case-badge { font-size: 0.875rem; font-weight: 600; color: var(--ws-blue-dark); }
.ap-case h3 { margin-top: 8px; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.025em; color: #f5f5f7; }
.ap-case dl { margin: 22px 0 28px; }
.ap-case dl > div + div { margin-top: 16px; }
.ap-case dt { font-size: 0.8125rem; font-weight: 600; color: var(--ws-muted-dark); }
.ap-case dd { margin-top: 4px; font-size: 0.9375rem; line-height: 1.45; color: #d2d2d7; }
.ws-page main .ap-case a { margin-top: auto; font-weight: 500; color: var(--ws-blue-dark); }

/* ---------------------------------------------------------- Odzivno */
@media (max-width: 960px) {
    .ap-cases { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 640px) {
    .ap-stage { height: auto; }
    .ap-scene { width: calc(100% - 16px); margin-inline: auto; }
    .ap-frag { display: none; }
    .ap-cap-before { display: none; }
    .ws-stage .ap-cap-0 { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ap-stage { height: auto; }
    .ap-scene { margin-inline: auto; }
    .ap-frag { display: none; }
    .ap-cap-before { display: none; }
    .ws-stage .ap-cap-0 { opacity: 1; }
}
