/* copyright Razvan Malciu - razvan.malciu@gmail.com */
/* --- Simulator interactiv (ecrane reale ale aplicatiei) --- */
.section-sim .section-head { margin-bottom: 22px; }
.apsim { position: relative; margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-deep); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); overflow: hidden; }
.apsim-subtitle { margin: 36px 0 6px; }
.apsim-intro { margin: 0 0 16px; }
.apsim-chrome { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.apsim-dots { display: inline-flex; gap: 6px; }
.apsim-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-3); }
.apsim-dots i:first-child { background: #FF5A4E; opacity: .85; }
.apsim-dots i:nth-child(2) { background: var(--amber); opacity: .85; }
.apsim-dots i:last-child { background: var(--green); opacity: .85; }
.apsim-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 13px/1 var(--font-mono); color: var(--text-2); letter-spacing: .02em; }
.apsim-title small { margin-left: 8px; color: var(--dim); font-size: 12px; }
.apsim-full { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.apsim-full:hover, .apsim-full:focus-visible { color: var(--text); border-color: var(--line-3); background: var(--surface-2); }
.apsim-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #07131A; overflow: hidden; }
.apsim-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.apsim-img.is-on { opacity: 1; }
.apsim-hots { position: absolute; inset: 0; }
.apsim-hots[hidden] { display: none; }
.apsim-hot { position: absolute; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.apsim-hot:hover, .apsim-hot:focus-visible { border-color: var(--green); background: rgba(63, 224, 160, .12); box-shadow: 0 0 0 3px rgba(63, 224, 160, .18); outline: none; }
.apsim-hot-back:hover, .apsim-hot-back:focus-visible { border-color: var(--amber); background: rgba(244, 183, 64, .14); box-shadow: 0 0 0 3px rgba(244, 183, 64, .18); }
.apsim-stage.is-hinting .apsim-hot { animation: apsim-pulse 1.8s ease-out 1; }
@keyframes apsim-pulse {
    0% { border-color: transparent; box-shadow: 0 0 0 0 rgba(63, 224, 160, 0); }
    30% { border-color: var(--green); box-shadow: 0 0 0 4px rgba(63, 224, 160, .22); }
    100% { border-color: transparent; box-shadow: 0 0 0 0 rgba(63, 224, 160, 0); }
}
.apsim-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(8, 18, 22, .88); border: 1px solid var(--line-3); color: var(--text); font: 500 13px/1 var(--font-mono); pointer-events: none; transition: opacity .3s; white-space: nowrap; }
.apsim-hint.is-gone { opacity: 0; }
.apsim-caption { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: rgba(8, 18, 22, .92); border: 1px solid var(--line-3); color: var(--text); font-size: 15px; line-height: 1.45; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.apsim-caption.is-on { opacity: 1; transform: none; }
.apsim.is-touring .apsim-hot { pointer-events: auto; }
.apsim-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line-2); }
.apsim-state { flex: 1 1 340px; margin: 0; min-height: 20px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.apsim-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.apsim .btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; gap: 8px; }
.apsim [data-apsim-tour].is-running { border-color: var(--green); color: var(--green); }
.apsim [data-apsim-tour].is-running .icon { animation: apsim-spin 1.6s linear infinite; }
@keyframes apsim-spin { to { transform: rotate(360deg); } }
.apsim-note { margin: 18px 0 0; }
.apsim.is-full { border-radius: 0; display: flex; flex-direction: column; background: #000; }
.apsim.is-full .apsim-stage { flex: 1; aspect-ratio: auto !important; }
.apsim.is-full .apsim-img { object-fit: contain; }
/* Telefon (Android): rama ingusta, centrata */
.apsim-phone { max-width: 360px; margin: 0 auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
/* Telefon: rama doar in jurul ecranului (proportia reala a capturii), titlul si comenzile in afara ramei */
.apsim-phone .apsim-chrome { display: none; }
.apsim-phone .apsim-stage { border: 8px solid #1C2B31; border-radius: 30px; box-shadow: 0 0 0 1px var(--line-3), 0 24px 50px rgba(0, 0, 0, .5); }
.apsim-phone .apsim-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0 0; background: transparent; border-top: 0; }
.apsim-phone .apsim-state { flex: 0 0 auto; text-align: center; }
.apsim-phone .apsim-controls { justify-content: center; }
/* TV: fara bara de ferestre */
.apsim-tv .apsim-chrome { background: #000; }
/* Clipuri video */
.apsim-clips:has(> :only-child) { max-width: 880px; margin-left: auto; margin-right: auto; }
.apsim-clips { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 24px; }
.apsim-clip { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.apsim-clip video { display: block; width: 100%; height: auto; background: #000; }
.apsim-clip figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.apsim-clip figcaption strong { display: block; color: var(--text); margin-bottom: 2px; }
@media (max-width: 720px) {
    .apsim-bar { flex-direction: column; align-items: stretch; }
    .apsim-controls { justify-content: flex-start; }
    .apsim-hint { font-size: 12px; bottom: 8px; }
    .apsim-caption { left: 8px; right: 8px; bottom: 8px; font-size: 13px; padding: 8px 10px; }
    .apsim-chrome { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .apsim-img, .apsim-caption, .apsim-hot, .apsim-hint { transition: none; }
    .apsim-stage.is-hinting .apsim-hot, .apsim [data-apsim-tour].is-running .icon { animation: none; }
}
/* --- Calculator AZ/EL (pagina AntennaPilot) --- */
.azel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 32px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.azel-copy .muted { margin: 10px 0 20px; }
.azel-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.azel-form .field input { font-family: var(--font-mono); }
.azel-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.azel .btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.azel-result { display: grid; gap: 16px; justify-items: center; }
.azel-dial { width: min(280px, 100%); height: auto; }
.azel-ring { fill: none; stroke: var(--line-3); stroke-width: 1; }
.azel-ring-in { stroke-dasharray: 2 4; }
.azel-tick { stroke: var(--dim); stroke-width: 2; }
.azel-ship { fill: var(--text-2); }
.azel-needle { stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; }
.azel-sat { fill: var(--amber); stroke: var(--bg); stroke-width: 2; }
.azel-lbl { fill: var(--dim); font: 500 10px var(--font-mono); text-anchor: middle; }
[data-azel-needle], .azel-sat { transition: transform .35s ease, cx .35s ease, cy .35s ease; }
.azel.is-below .azel-needle { stroke: var(--red); }
.azel-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; width: 100%; margin: 0; }
.azel-out div { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-deep); }
.azel-out dt { color: var(--dim); font: 500 12px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.azel-out dd { margin: 4px 0 0; color: var(--text); font: 600 22px/1.1 var(--font-mono); }
.azel-out .azel-cmd { grid-column: 1 / -1; }
.azel-out .azel-cmd dd { color: var(--green); white-space: pre; }
.azel-msg { min-height: 20px; margin: 0; color: var(--amber); font-size: 14px; text-align: center; }
@media (max-width: 960px) { .azel { grid-template-columns: 1fr; padding: 22px; } }
@media (max-width: 560px) { .azel-form, .azel-out { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { [data-azel-needle], .azel-sat { transition: none; } }
/* --- Telefon (<= 720px): forma veche, fara simulator, calculator si butoane Try it --- */
@media (max-width: 720px) {
    .section-sim, #azel, .sim-only { display: none !important; }
}
@media (min-width: 721px) {
    .sim-mobile-only { display: none !important; }
}
/* --- Clipuri video ascunse sub un singur buton, ca sa nu incarce pagina --- */
.apsim-video { margin-top: 18px; }
.apsim-video > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-4, var(--line-3)); border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
.apsim-video > summary::-webkit-details-marker { display: none; }
.apsim-video > summary:hover, .apsim-video > summary:focus-visible { border-color: var(--green); }
.apsim-video[open] > summary { margin-bottom: 4px; }
/* --- Simulatoarele secundare (Android, TV, telefon) sub un singur buton --- */
.apsim-more { margin-top: 28px; border-top: 1px solid var(--line-2); padding-top: 22px; }
.apsim-more > summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--text); }
.apsim-more > summary::-webkit-details-marker { display: none; }
.apsim-more > summary::after { content: "+"; margin-left: 6px; color: var(--green); font-family: var(--font-mono); font-size: 20px; }
.apsim-more[open] > summary::after { content: "-"; }
.apsim-more > summary:hover, .apsim-more > summary:focus-visible { color: var(--green); }
.apsim-more .apsim-intro { margin: 10px 0 18px; }
.page-hero + .section-sim { padding-top: clamp(28px, 4vw, 48px); }
