/* screen-recorder.php: builds on css/theme.css (.sv-hero, .sr-card, .sv-steps, .sv-faq). */
.rec-page { --rec-red: #ff3b5c; --rec-line: var(--sv-line, #e4e9f2); }

/* ---------- hero: text left, a small animated "recording" window right ---------- */
.rec-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 34px; align-items: center; }
.rec-hero h1 { max-width: 560px; }
@media (max-width: 991px) { .rec-hero { grid-template-columns: minmax(0, 1fr); } .rec-mock { max-width: 520px; } }

.rec-mock { border-radius: 16px; overflow: hidden; background: #0b1020; border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 30px 70px rgba(5, 10, 40, .45); transform: perspective(1200px) rotateY(-6deg) rotateX(2deg); }
.rec-mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: rgba(255, 255, 255, .08); }
.rec-mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.rec-mock-bar i:nth-child(2) { background: #febc2e; }
.rec-mock-bar i:nth-child(3) { background: #28c840; }
.rec-mock-bar span { margin-left: 10px; flex: 1; font-size: 11.5px; color: #aab6e8; background: rgba(255, 255, 255, .08); border-radius: 6px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-mock-screen { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(160deg, #f6f8ff, #e6ecff); overflow: hidden;
    box-shadow: inset 0 0 0 3px var(--rec-red); animation: rec-frame 2s ease-in-out infinite; }
.rec-mock-slide { position: absolute; left: 7%; top: 12%; width: 46%; display: flex; flex-direction: column; gap: 9px; }
.rec-mock-slide b { height: 16px; width: 80%; border-radius: 6px; background: #1d2f7a; }
.rec-mock-slide span { height: 9px; border-radius: 5px; background: #c3cdf0; }
.rec-mock-slide span.short { width: 60%; }
.rec-mock-chart { position: absolute; right: 7%; bottom: 14%; width: 36%; height: 46%; display: flex; align-items: flex-end; gap: 8%;
    padding: 10px; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(29, 47, 122, .12); }
.rec-mock-chart i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #6a8bff, #2f5bff); }
.rec-mock-cursor { position: absolute; left: 30%; top: 62%; font-size: 22px; color: #10183a; text-shadow: 0 0 0 #fff, 1px 1px 0 #fff, -1px -1px 0 #fff;
    animation: rec-cursor 6s ease-in-out infinite; }
.rec-mock-pill { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
    background: rgba(10, 15, 35, .78); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.rec-mock-pill b { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-mock-wave { position: absolute; left: 7%; bottom: 14%; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(10, 15, 35, .78); }
.rec-mock-wave i { width: 4px; height: 30%; border-radius: 2px; background: #4ade80; animation: rec-wave 1s ease-in-out infinite; }
.rec-mock-wave i:nth-child(2) { animation-delay: -.2s; } .rec-mock-wave i:nth-child(3) { animation-delay: -.5s; }
.rec-mock-wave i:nth-child(4) { animation-delay: -.1s; } .rec-mock-wave i:nth-child(5) { animation-delay: -.7s; }
.rec-mock-wave i:nth-child(6) { animation-delay: -.3s; } .rec-mock-wave i:nth-child(7) { animation-delay: -.6s; }

.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec-red); box-shadow: 0 0 0 0 rgba(255, 59, 92, .7); animation: rec-pulse 1.4s ease-out infinite; flex: none; }

@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .7); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); } }
@keyframes rec-wave { 0%, 100% { height: 25%; } 50% { height: 85%; } }
@keyframes rec-cursor { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(120px, -60px); } 60% { transform: translate(60px, 30px); } }
@keyframes rec-frame { 0%, 100% { box-shadow: inset 0 0 0 3px rgba(255, 59, 92, .95); } 50% { box-shadow: inset 0 0 0 3px rgba(255, 59, 92, .35); } }
@media (prefers-reduced-motion: reduce) { .rec-mock *, .rec-mock-screen, .rec-dot { animation: none !important; } .rec-mock { transform: none; } }

/* ---------- tool ---------- */
.rec-unsupported { display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: 16px; background: #fff7ed; border: 1px solid #fed7aa; }
.rec-unsupported > .fa { font-size: 32px; color: #ea580c; }
.rec-unsupported div { display: flex; flex-direction: column; gap: 2px; }
.rec-unsupported span { color: var(--sv-muted, #556179); }

.rec-options { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 18px; }
.rec-opt { display: flex; align-items: center; gap: 12px; }
.rec-opt-label { font-weight: 700; color: var(--sv-ink, #0f172a); font-size: 14px; }
.rec-seg { display: inline-flex; padding: 4px; border-radius: 12px; background: #eef2fb; border: 1px solid var(--rec-line); }
.rec-seg label { margin: 0 !important; cursor: pointer; }
.rec-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rec-seg span { display: block; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--sv-muted, #556179); transition: background .15s, color .15s, box-shadow .15s; }
.rec-seg input:checked + span { background: #fff; color: var(--sv-primary, #2f5bff); box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.rec-seg input:focus-visible + span { outline: 3px solid #c9d5ff; }

.rec-toggles { display: grid; gap: 10px; margin-bottom: 22px; }
.rec-toggle { display: flex; align-items: flex-start; gap: 14px; margin: 0 !important; padding: 14px 16px; border: 1px solid var(--rec-line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.rec-toggle:hover { border-color: #c3cff5; }
.rec-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rec-switch { flex: none; position: relative; width: 42px; height: 24px; margin-top: 2px; border-radius: 999px; background: #cfd7e8; transition: background .2s; }
.rec-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.rec-toggle input:checked + .rec-switch { background: var(--sv-primary, #2f5bff); }
.rec-toggle input:checked + .rec-switch::after { transform: translateX(18px); }
.rec-toggle input:focus-visible + .rec-switch { outline: 3px solid #c9d5ff; outline-offset: 2px; }
.rec-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.rec-toggle-text b { color: var(--sv-ink, #0f172a); font-size: 15px; }
.rec-toggle-text b .fa { color: var(--sv-primary, #2f5bff); width: 18px; }
.rec-toggle-text small { color: var(--sv-muted, #556179); font-size: 13px; font-weight: 400; }
.rec-mic-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -4px 0 0 56px; }
.rec-mic-pick[hidden] { display: none; }
.rec-mic-pick select { flex: 1 1 240px; max-width: 420px; border-radius: 10px; }
.rec-meter { display: inline-block; position: relative; width: 120px; height: 8px; border-radius: 999px; background: #e5eaf5; overflow: hidden; vertical-align: middle; }
.rec-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, #4ade80, #facc15 70%, #f87171); transition: width .08s linear; }

.rec-start { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 18px; border: 0; border-radius: 16px; cursor: pointer;
    font-size: 19px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff3b5c, #ff6b3d); box-shadow: 0 16px 34px rgba(255, 59, 92, .32);
    transition: transform .15s, box-shadow .15s, opacity .15s; }
.rec-start:hover { transform: translateY(-1px); box-shadow: 0 20px 40px rgba(255, 59, 92, .4); }
.rec-start:focus-visible { outline: 3px solid #ffd666; outline-offset: 3px; }
.rec-start:disabled { opacity: .6; cursor: wait; transform: none; }
.rec-start-dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .3); }
.rec-hint { text-align: center; color: var(--sv-muted, #556179); font-size: 13.5px; margin: 10px 0 0; }

/* live */
.rec-stage { position: relative; border-radius: 16px; overflow: hidden; background: #0b1020; aspect-ratio: 16 / 9; box-shadow: inset 0 0 0 3px var(--rec-red); }
.rec-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.rec-live-pill { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    background: rgba(10, 15, 35, .78); color: #fff; font-size: 14px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rec-live-pill[hidden] { display: none; }
.rec-live-pill b { letter-spacing: .06em; font-size: 12.5px; }
.rec-live-pill span:last-child { font-variant-numeric: tabular-nums; }
.rec-live-pill.paused .rec-dot { background: #facc15; animation: none; }
.rec-countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 15, 35, .62); }
.rec-countdown[hidden] { display: none; }
.rec-countdown span { font-size: clamp(80px, 14vw, 160px); font-weight: 800; color: #fff; text-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.rec-countdown span.pop { animation: rec-pop 1s ease-out; }
@keyframes rec-pop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .2; } }
.rec-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.rec-bar-info { display: flex; gap: 22px; flex-wrap: wrap; color: var(--sv-muted, #556179); }
.rec-bar-info b { color: var(--sv-ink, #0f172a); font-variant-numeric: tabular-nums; }
.rec-bar-info .fa { color: var(--sv-primary, #2f5bff); margin-right: 3px; }
.rec-bar-mic[hidden] { display: none; }
.rec-bar-btns { display: flex; gap: 10px; }
.rec-bar-btns .btn { border-radius: 12px; font-weight: 700; padding: .65rem 1.3rem; }
.rec-btn-pause { background: #eef2fb; color: var(--sv-ink, #0f172a); border: 1px solid var(--rec-line); }
.rec-btn-pause:hover { background: #e3e9f7; }
.rec-btn-stop { background: var(--rec-red); color: #fff; }
.rec-btn-stop:hover { background: #e62e4e; color: #fff; }

.rec-error { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: #fff4f4; border: 1px solid #fecaca; color: #9f1239; font-size: 14px; }
.rec-error[hidden] { display: none; }

/* takes */
.rec-takes { display: grid; gap: 16px; margin-top: 20px; }
.rec-takes:empty { display: none; }
.rec-take { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border: 1px solid var(--rec-line); border-radius: 16px; overflow: hidden; background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06); animation: rec-in .35s ease-out; }
@keyframes rec-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rec-take video { width: 100%; height: 100%; min-height: 200px; max-height: 360px; background: #0b1020; display: block; }
.rec-take-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.rec-take-head { display: flex; align-items: center; gap: 10px; }
.rec-take-head b { font-size: 17px; color: var(--sv-ink, #0f172a); }
.rec-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: #eef2ff; color: var(--sv-primary, #2f5bff); }
.rec-take-meta { display: flex; gap: 18px; color: var(--sv-muted, #556179); font-size: 14px; }
.rec-take-meta .fa { color: var(--sv-primary, #2f5bff); }
.rec-take-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.rec-take-btns .btn { border-radius: 11px; font-weight: 700; }
.rec-btn-dl { background: var(--sv-primary, #2f5bff); color: #fff; }
.rec-btn-dl:hover { background: var(--sv-primary-dark, #1f44d6); color: #fff; }
.rec-btn-sub { background: #eef2ff; color: var(--sv-primary, #2f5bff); }
.rec-btn-sub:hover { background: #e0e7ff; color: var(--sv-primary-dark, #1f44d6); }
.rec-btn-del { background: transparent; color: var(--sv-muted, #556179); border: 1px solid var(--rec-line); }
.rec-btn-del:hover { color: #be123c; border-color: #fecaca; background: #fff4f4; }
.rec-take-note { margin: 0; font-size: 12.5px; color: var(--sv-muted, #556179); }
@media (max-width: 767px) { .rec-take { grid-template-columns: minmax(0, 1fr); } .rec-mic-pick { margin-left: 0; } }

.rec-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 16px 0 0; margin: 20px 0 0; border-top: 1px solid var(--rec-line); color: #2b3650; font-size: 14px; font-weight: 600; }
.rec-trust .fa { color: var(--sv-success, #12b886); margin-right: 6px; }
a.rec-next { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.rec-next:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15, 23, 42, .1); text-decoration: none; color: inherit; }
