/**
 * Little Rascal — Studio Apps (component specimen gallery)
 * Page creation: 18/10/2026 19:15
 * Page modified: 18/10/2026 20:05 — added code-capture panel styling.
 *
 * Faithful reproduction of the noah-resume.uk component demo. Every rule is
 * scoped under .studio-apps so the live Little Rascal design system is left
 * untouched and the specimens render exactly as demonstrated. Controls are
 * CSSOM-driven in studio-apps.js (no inline script/style; CSP-safe).
 * Themes carried on .theme-* classes, shared across cards, toggles and inputs.
 */

/* Scoped reset — replaces the original global `* {}` reset. */
.studio-apps *,
.studio-apps *::before,
.studio-apps *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Dynamic variables — were :root in the original; scoped to the container so
   studio-apps.js can drive them without leaking to the document. */
.studio-apps {
    --dynamic-border-width: 6px;
    --dynamic-border-opacity: 0.4;
}

/* Stage — the original <body> environment, boxed inside the LR page. */
.studio-apps__stage {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #e9ecef;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    border-radius: 12px;
}

/* =========================================
   Centralised base form styles
========================================= */
.studio-apps .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.studio-apps label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.studio-apps input[type="text"],
.studio-apps input[type="email"],
.studio-apps input[type="password"],
.studio-apps input[type="number"],
.studio-apps select,
.studio-apps textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.studio-apps input[type="text"]::placeholder,
.studio-apps textarea::placeholder {
    color: #94a3b8;
}

.studio-apps input[type="text"]:focus,
.studio-apps select:focus,
.studio-apps textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* =========================================
   Control panel UI
========================================= */
.studio-apps .page-header {
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.studio-apps .controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.studio-apps .slide-toggle-control { min-width: 250px; }

.studio-apps .slide-toggle-control label {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

.studio-apps .slide-toggle-control output {
    color: #0284c7;
    font-family: monospace;
    font-size: 1.1rem;
}

.studio-apps .slide-toggle-control input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.studio-apps .toggle-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.studio-apps .control-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

/* =========================================
   Card layout
========================================= */
.studio-apps .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
}

/* =========================================
   Base card architecture
========================================= */
.studio-apps .info-card {
    border-radius: 16px;
    border: var(--dynamic-border-width) solid rgba(var(--border-rgb), var(--dynamic-border-opacity));
    background-color: var(--bg);
    color: var(--text);
    background-clip: padding-box;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-apps .info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.studio-apps .info-card h2 {
    font-size: 1.5rem;
    color: var(--heading);
}

.studio-apps .info-card p {
    line-height: 1.6;
    flex-grow: 1;
    font-size: 0.95rem;
    opacity: 0.9;
}

.studio-apps .info-card footer { margin-top: 1rem; }

/* Base button UI */
.studio-apps .btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    background-color: var(--accent);
    color: var(--btn-text);
    transition: filter 0.2s ease;
}

.studio-apps .btn:hover,
.studio-apps .btn:focus { filter: brightness(1.15); }

/* =========================================
   Entrance animation logic
========================================= */
@keyframes sa-slowDissolve {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.studio-apps .animate-mode .info-card {
    opacity: 0;
    animation: sa-slowDissolve 1.2s ease-out forwards;
}

.studio-apps .animate-mode .info-card:nth-child(1) { animation-delay: 0.1s; }
.studio-apps .animate-mode .info-card:nth-child(2) { animation-delay: 0.4s; }
.studio-apps .animate-mode .info-card:nth-child(3) { animation-delay: 0.7s; }
.studio-apps .animate-mode .info-card:nth-child(4) { animation-delay: 1.0s; }
.studio-apps .animate-mode .info-card:nth-child(5) { animation-delay: 1.3s; }
.studio-apps .animate-mode .info-card:nth-child(6) { animation-delay: 1.6s; }

/* =========================================
   Premium separator
========================================= */
.studio-apps .premium-separator {
    width: 100%;
    max-width: 1200px;
    height: 3px;
    border: none;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.15), transparent);
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* =========================================
   UI showcase layouts (toggles & inputs)
========================================= */
.studio-apps .ui-showcase {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.studio-apps .showcase-group h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.25rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.studio-apps .showcase-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.studio-apps .text-toggles,
.studio-apps .inputs-grid { flex-direction: column; }

/* =========================================
   Themed inputs implementation
========================================= */
.studio-apps .square-input input,
.studio-apps .radius-input input {
    background-color: rgba(var(--border-rgb), 0.02);
}

.studio-apps .square-input input:focus,
.studio-apps .radius-input input:focus {
    border-color: rgba(var(--border-rgb), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--border-rgb), 0.15);
}

.studio-apps .square-input input {
    border-radius: 0;
    border: 2px solid rgba(var(--border-rgb), 0.1);
}

.studio-apps .radius-input input {
    border-radius: 12px;
    border: 4px solid rgba(var(--border-rgb), 0.1);
    background-clip: padding-box;
}

/* =========================================
   Reusable UI block: slide toggle
========================================= */
.studio-apps .custom-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.studio-apps .custom-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.studio-apps .switch-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: #cbd5e1;
    border-radius: 34px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.studio-apps .switch-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.studio-apps .custom-switch input:checked + .switch-slider {
    background-color: var(--accent);
}

.studio-apps .custom-switch input:checked + .switch-slider::before {
    transform: translateX(24px);
}

.studio-apps .custom-switch input:focus-visible + .switch-slider {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.studio-apps .status-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b;
    transition: color 0.3s ease;
}

.studio-apps .status-text::before { content: attr(data-off); }

.studio-apps .custom-switch input:checked ~ .status-text { color: var(--accent); }

.studio-apps .custom-switch input:checked ~ .status-text::before { content: attr(data-on); }

/* =========================================
   Themes (shared across cards, toggles, inputs)
========================================= */
.studio-apps .theme-oceanic {
    --bg: #0f172a;
    --text: #cbd5e1;
    --heading: #38bdf8;
    --accent: #0284c7;
    --btn-text: #ffffff;
    --border-rgb: 56, 189, 248;
}

.studio-apps .theme-pastel {
    --bg: #fdfbf7;
    --text: #5c5c5c;
    --heading: #d97777;
    --accent: #d97777;
    --btn-text: #ffffff;
    --border-rgb: 217, 119, 119;
    text-align: center;
}

.studio-apps .theme-cyber {
    --bg: #000000;
    --text: #a3a3a3;
    --heading: #39ff14;
    --accent: #39ff14;
    --btn-text: #000000;
    --border-rgb: 57, 255, 20;
    border-radius: 0;
    text-transform: uppercase;
    font-family: monospace;
}
.studio-apps .theme-cyber h2 { letter-spacing: 2px; }
.studio-apps .theme-cyber.custom-switch .switch-slider { border-radius: 0; }
.studio-apps .theme-cyber.custom-switch .switch-slider::before { border-radius: 0; }

.studio-apps .theme-minimal {
    --bg: #ffffff;
    --text: #000000;
    --heading: #000000;
    --accent: #000000;
    --btn-text: #ffffff;
    --border-rgb: 0, 0, 0;
    border-style: dashed;
}

.studio-apps .theme-sunset {
    --bg: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    --text: #4a4a4a;
    --heading: #ffffff;
    --accent: #ff758c;
    --btn-text: #ffffff;
    --border-rgb: 255, 255, 255;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.studio-apps .theme-corporate {
    --bg: #ffffff;
    --text: #4b5563;
    --heading: #1e3a8a;
    --accent: #1e3a8a;
    --btn-text: #ffffff;
    --border-rgb: 30, 58, 138;
}

/* =========================================
   Code capture panel (premium dark, GitHub-dark palette)
========================================= */
.studio-apps .sa-capture {
    width: 100%;
    max-width: 1200px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.studio-apps .sa-capture__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.studio-apps .sa-capture__title {
    margin: 0;
    margin-right: auto;
    color: #e6edf3;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.studio-apps .sa-capture__tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #0d1117;
    border-radius: 8px;
}

.studio-apps .sa-capture__tab {
    appearance: none;
    border: none;
    background: transparent;
    color: #8b949e;
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.studio-apps .sa-capture__tab:hover { color: #e6edf3; }

.studio-apps .sa-capture__tab.is-active {
    background: #30363d;
    color: #ffffff;
}

.studio-apps .sa-capture__actions {
    display: inline-flex;
    gap: 0.5rem;
}

.studio-apps .sa-capture__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #30363d;
    background: #21262d;
    color: #e6edf3;
    font: inherit;
    font-size: 0.78rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.studio-apps .sa-capture__btn:hover { background: #30363d; }

.studio-apps .sa-capture__btn:focus-visible {
    outline: 2px solid #388bfd;
    outline-offset: 2px;
}

.studio-apps .sa-capture__btn.is-done {
    border-color: #2ea043;
    color: #3fb950;
}

.studio-apps .sa-capture__panels {
    max-height: 420px;
    overflow: auto;
}

.studio-apps .sa-capture__code {
    display: none;
    margin: 0;
    padding: 1.25rem;
    color: #e6edf3;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre;
    tab-size: 2;
}

.studio-apps .sa-capture__code.is-active { display: block; }

.studio-apps .sa-capture__code code {
    font: inherit;
    color: inherit;
    background: none;
    padding: 0;
}
