/* =====================================================================
   Tethar — Live Demo & Upload Studio styles
   ===================================================================== */

.demo-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 44px; align-items: start; }
@media (max-width: 920px) { .demo-wrap { grid-template-columns: 1fr; gap: 34px; } }

/* Interactive phone (larger, clickable) */
.demo-phone { position: sticky; top: 100px; justify-self: center; }
@media (max-width: 920px) { .demo-phone { position: static; } }
.demo-phone .phone { width: 300px; }
.demo-screen-app { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 46px 18px 16px; background: radial-gradient(90% 60% at 20% 0%, rgba(129,140,248,.28), transparent 60%), var(--grad-ink); color: #fff; }

.d-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.d-head .who { display: flex; align-items: center; gap: 9px; }
.d-head .app-avatar { width: 34px; height: 34px; }
.d-head small { color: rgba(255,255,255,.55); font-size: .68rem; display: block; }
.d-head strong { font-size: .86rem; }

/* Tabs content */
.d-view { flex: 1; display: none; flex-direction: column; gap: 12px; animation: fadeUp .35s var(--ease); }
.d-view.active { display: flex; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.d-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); border-radius: 16px; padding: 13px 14px; }
.d-card .label { font-size: .68rem; color: rgba(255,255,255,.6); }
.d-card .big { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; margin-top: 3px; }
.d-card .big span { font-size: .8rem; color: rgba(255,255,255,.5); font-weight: 500; }
.d-ring { display: grid; place-items: center; padding: 6px 0; }
.d-ring svg { width: 128px; height: 128px; }
.d-ring .rtxt { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; fill: #fff; }
.d-ring .rsub { fill: rgba(255,255,255,.55); font-size: .5rem; }

.d-toggle { display: flex; align-items: center; gap: 11px; padding: 4px 2px; }
.d-toggle .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.d-toggle .ic svg { width: 17px; height: 17px; }
.d-toggle .tx { flex: 1; }
.d-toggle .tx b { font-size: .8rem; display: block; }
.d-toggle .tx small { font-size: .66rem; color: rgba(255,255,255,.5); }
.d-toggle .sw { cursor: pointer; }

.d-app-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid rgba(255,255,255,.06); }
.d-app-row:first-child { border-top: none; }
.d-app-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .9rem; flex: none; }
.d-app-row .nm { flex: 1; font-size: .78rem; font-weight: 500; }
.d-app-row .mini { font-size: .62rem; padding: .2rem .5rem; border-radius: 99px; font-weight: 600; }
.mini.ok { background: rgba(52,211,153,.18); color: var(--mint-400); }
.mini.blk { background: rgba(251,113,133,.18); color: var(--coral-500); }
.mini.req { background: rgba(251,191,36,.2); color: var(--amber-400); cursor: pointer; }

.d-map { position: relative; border-radius: 14px; overflow: hidden; height: 150px; background: linear-gradient(160deg,#141d3d,#0b1024); border: 1px solid rgba(255,255,255,.09); }
.d-map .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 26px 26px; }
.d-map .zone { position: absolute; width: 78px; height: 78px; border-radius: 50%; border: 1.5px dashed rgba(52,211,153,.6); background: rgba(52,211,153,.1); left: 44%; top: 30%; }
.d-map .pin { position: absolute; left: 55%; top: 46%; color: var(--coral-500); animation: pinPulse 2s var(--ease) infinite; }
.d-map .pin svg { width: 26px; height: 26px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
@keyframes pinPulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Bottom tab bar */
.d-tabs { display: flex; justify-content: space-around; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.d-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .58rem; color: rgba(255,255,255,.5); padding: 4px 8px; border-radius: 10px; transition: color .2s, background .2s; }
.d-tab svg { width: 20px; height: 20px; }
.d-tab.active { color: #fff; }
.d-tab.active .tabic { color: var(--indigo-400); }
.tabic { color: rgba(255,255,255,.5); transition: color .2s; }

/* Right panel */
.demo-panel { min-width: 0; }
.demo-tablist { display: inline-flex; gap: 6px; padding: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 26px; flex-wrap: wrap; }
.demo-tablist button { padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--text-soft); transition: all .25s var(--ease); }
.demo-tablist button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.demo-note { display: flex; gap: 12px; padding: 16px 18px; background: var(--grad-brand-soft); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 26px; }
.demo-note svg { width: 22px; height: 22px; color: var(--indigo-600); flex: none; margin-top: 1px; }
.demo-note p { font-size: .92rem; color: var(--text-soft); }
.demo-note b { color: var(--text); }

/* ---- Upload studio ---- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
  padding: 44px 28px; text-align: center; transition: border-color .25s, background .25s, transform .25s;
  cursor: pointer; position: relative;
}
.dropzone:hover { border-color: var(--indigo-400); background: var(--surface-2); }
.dropzone.drag { border-color: var(--indigo-500); background: var(--grad-brand-soft); transform: scale(1.005); }
.dropzone .dz-ic { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.dropzone .dz-ic svg { width: 30px; height: 30px; }
.dropzone h3 { margin-bottom: 6px; }
.dropzone p { color: var(--text-soft); font-size: .94rem; }
.dropzone .types { margin-top: 14px; font-size: .8rem; color: var(--text-muted); }
.dropzone input { display: none; }

.uploader-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 24px 0 14px; }
.uploader-actions .count { font-size: .9rem; color: var(--text-muted); }
.uploader-actions .count b { color: var(--text); }

/* Gallery of uploaded demos, shown inside device frames */
.showcase-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px; }
.demo-item { position: relative; }
.demo-frame {
  position: relative; border-radius: 30px; padding: 8px; background: linear-gradient(160deg,#20264a,#0c1026);
  box-shadow: var(--shadow-md); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.demo-item:hover .demo-frame { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.demo-frame::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 64px; height: 15px; background: #0b0e1e; border-radius: 0 0 10px 10px; z-index: 3; }
.demo-media { border-radius: 24px; overflow: hidden; aspect-ratio: 9/19.5; background: #05070f; display: grid; place-items: center; }
.demo-media img, .demo-media video { width: 100%; height: 100%; object-fit: cover; }
.demo-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 0 4px; }
.demo-cap .nm { font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-cap .rm { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); flex: none; transition: color .2s, border-color .2s; }
.demo-cap .rm:hover { color: var(--coral-500); border-color: var(--coral-500); }
.demo-cap .rm svg { width: 15px; height: 15px; }
.demo-type { position: absolute; top: 16px; left: 16px; z-index: 4; font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 99px; background: rgba(11,16,36,.75); color: #fff; backdrop-filter: blur(4px); }
.demo-media .play { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; color: var(--ink-800); pointer-events: none; }
.demo-media .play svg { width: 22px; height: 22px; margin-left: 3px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--border-strong); }

/* APK / build card */
.build-card { display: flex; gap: 16px; align-items: center; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.build-card .b-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-brand-soft); color: var(--indigo-600); flex: none; }
.build-card .b-ic svg { width: 24px; height: 24px; }
.build-card .b-meta { flex: 1; min-width: 0; }
.build-card .b-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-card .b-meta small { color: var(--text-muted); font-size: .84rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(6,9,20,.88); backdrop-filter: blur(8px); display: none; place-items: center; padding: 30px; }
.lightbox.open { display: grid; }
.lightbox .lb-inner { max-width: 380px; width: 100%; }
.lightbox .phone { width: 100%; }
.lightbox .lb-close { position: absolute; top: 22px; right: 26px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.lightbox .lb-close svg { width: 22px; height: 22px; }
.lightbox .phone-screen { display: grid; place-items: center; background: #05070f; }
.lightbox .phone-screen img, .lightbox .phone-screen video { width: 100%; height: 100%; object-fit: contain; }

/* ---- Interactive app tour ---- */
.tour { max-width: 900px; margin-inline: auto; }
.tour-stage { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tour .phone { width: 300px; }
.tour .phone-screen { aspect-ratio: 9 / 19.5; }
.tour-screen { position: relative; overflow: hidden; }
.tour-screen img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s ease; }
.tour-hotspots { position: absolute; inset: 0; }
.tour-hotspots button { position: absolute; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 10px; transition: background .15s, box-shadow .15s; }
.tour-hotspots button:hover, .tour-hotspots button:focus-visible { background: rgba(32,181,182,.16); box-shadow: inset 0 0 0 2px rgba(32,181,182,.6); outline: none; }
.tour-arrow { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--text); flex: none; cursor: pointer; transition: transform .2s, color .2s, border-color .2s, box-shadow .2s; }
.tour-arrow:hover { color: var(--purple-600); border-color: var(--purple-400); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tour-arrow svg { width: 24px; height: 24px; }
.tour-caption { text-align: center; margin-top: 20px; }
.tour-caption b { font-family: var(--font-display); font-size: 1.15rem; display: block; color: var(--text); }
.tour-caption span { color: var(--text-soft); font-size: .96rem; }
.tour-hint { text-align: center; color: var(--text-muted); font-size: .82rem; margin-top: 10px; }
.tour-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.tour-chips button { padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: .85rem; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.tour-chips button:hover { border-color: var(--purple-400); color: var(--text); }
.tour-chips button.active { background: var(--grad-brand); color: #fff; border-color: transparent; }
@media (max-width: 520px) { .tour .phone { width: 250px; } .tour-arrow { width: 42px; height: 42px; } .tour-arrow svg { width: 20px; height: 20px; } }

/* ---- App demo video ---- */
.video-stage { display: flex; justify-content: center; }
.video-stage .phone { width: 300px; }
.video-stage .phone-screen { aspect-ratio: 540 / 1210; }
.video-screen { position: relative; overflow: hidden; }
.video-screen video { width: 100%; height: 100%; object-fit: cover; display: block; background: #05070f; }
