/* ═══════════════════════════════════════════════════════════════════════════
   V4 LAYOUT — Page chrome: navbar, header, footer, modals, embeds
   Async-loaded — not needed for above-the-fold paint
   Updated: 2026-02-11
   Changes: Fixed button vs anchor sizing mismatch in navbar (v4-nav-dropdown-trigger).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Skip link for keyboard users */
.v4-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: var(--v4-space-3) var(--v4-space-4);
    background: var(--v4-bg-surface);
    color: var(--v4-text-primary);
    text-decoration: none;
    font-weight: 600;
}

.v4-skip-link:focus {
    left: var(--v4-space-4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--v4-bg-panel);
    border-bottom: 1px solid var(--v4-border-base);
    backdrop-filter: blur(12px);
}

.v4-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--v4-max-width);
    margin: 0 auto;
    padding: var(--v4-space-3) var(--v4-space-6);
    gap: var(--v4-space-6);
}

/* Logo */
.v4-logo {
    display: flex;
    align-items: center;
    gap: var(--v4-space-3);
    text-decoration: none;
    color: var(--v4-primary);
}

.v4-logo-signal {
    display: flex;
    align-items: center;
    gap: 3px;
}

.v4-signal-dot,
.v4-signal-dash {
    background: var(--v4-primary);
    border-radius: 2px;
    animation: pulse-signal 2s ease-in-out infinite;
}

.v4-signal-dot {
    width: 6px;
    height: 6px;
}

.v4-signal-dash {
    width: 16px;
    height: 6px;
    animation-delay: 0.3s;
}

@keyframes pulse-signal {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; box-shadow: var(--v4-glow-text); }
}

.v4-logo-text {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-md);
    font-weight: 700;
    letter-spacing: var(--v4-tracking-wider);
    text-shadow: var(--v4-glow-text);
}

.v4-logo-accent {
    color: var(--v4-text-primary);
    font-weight: 500;
}

/* Nav Links */
.v4-nav-links {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
}

.v4-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-2) var(--v4-space-4);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    font-weight: 500;
    letter-spacing: var(--v4-tracking-wide);
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--v4-radius-md);
    transition: all 0.2s ease;
}

.v4-nav-link:hover {
    color: var(--v4-primary);
    background: var(--v4-primary-subtle);
    border-color: var(--v4-border-dim);
}

.v4-nav-link.active {
    color: var(--v4-primary);
    background: var(--v4-primary-subtle);
    border-color: var(--v4-border-base);
}

.v4-nav-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v4-text-muted);
    transition: all 0.2s ease;
}

.v4-nav-link.active .v4-nav-indicator {
    background: var(--v4-primary);
    box-shadow: var(--v4-glow-text);
}

/* Nav Controls */
.v4-nav-controls {
    display: flex;
    align-items: center;
    gap: var(--v4-space-3);
}

/* Theme Selector */
.v4-theme-selector {
    display: flex;
    align-items: center;
    gap: var(--v4-space-1);
    padding: var(--v4-space-1);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-full);
}

.v4-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.v4-theme-btn:hover,
.v4-theme-btn.active {
    border-color: var(--v4-primary);
}

.v4-theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

/* Dark Themes */
.v4-theme-dot.amber { background: #FF9500; }
.v4-theme-dot.phosphor { background: #33FF33; }
.v4-theme-dot.arctic { background: #38BDF8; }
.v4-theme-dot.crimson { background: #F87171; }
.v4-theme-dot.violet { background: #A78BFA; }
.v4-theme-dot.cyan { background: #22D3EE; }
.v4-theme-dot.matrix { background: #00FF41; }

/* Light Themes (with split indicator) */
.v4-theme-dot.paper { background: linear-gradient(135deg, #F5F0E6 50%, #8B4513 50%); }
.v4-theme-dot.sky { background: linear-gradient(135deg, #F0F9FF 50%, #0EA5E9 50%); }
.v4-theme-dot.mint { background: linear-gradient(135deg, #ECFDF5 50%, #059669 50%); }
.v4-theme-dot.rose { background: linear-gradient(135deg, #FDF4F9 50%, #DB2777 50%); }
.v4-theme-dot.slate { background: linear-gradient(135deg, #F8FAFC 50%, #475569 50%); }

.v4-theme-btn:hover .v4-theme-dot {
    transform: scale(1.1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME DROPDOWN
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-theme-dropdown {
    position: relative;
}

.v4-theme-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-2) var(--v4-space-3);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.v4-theme-dropdown-btn:hover {
    border-color: var(--v4-border-base);
    color: var(--v4-text-primary);
}

.v4-theme-dot-current {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--v4-primary);
}

.v4-theme-name {
    min-width: 60px;
}

.v4-dropdown-arrow {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.v4-theme-dropdown.open .v4-dropdown-arrow {
    transform: rotate(180deg);
}

.v4-theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--v4-bg-panel);
    border: 1px solid var(--v4-border-base);
    border-radius: var(--v4-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
}

.v4-theme-dropdown.open .v4-theme-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.v4-theme-group {
    padding: var(--v4-space-2);
}

.v4-theme-group + .v4-theme-group {
    border-top: 1px solid var(--v4-border-dim);
}

.v4-theme-group-label {
    padding: var(--v4-space-1) var(--v4-space-2);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--v4-text-muted);
}

.v4-theme-option {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    width: 100%;
    padding: var(--v4-space-2) var(--v4-space-2);
    background: transparent;
    border: none;
    border-radius: var(--v4-radius-sm);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.v4-theme-option:hover {
    background: var(--v4-primary-subtle);
    color: var(--v4-text-primary);
}

.v4-theme-option.active {
    background: var(--v4-primary-subtle);
    color: var(--v4-primary);
}

.v4-theme-option .v4-theme-dot {
    width: 12px;
    height: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS BUTTON (in control panel)
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-settings-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.v4-settings-btn {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-2) var(--v4-space-4);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.v4-settings-btn:hover {
    border-color: var(--v4-primary);
    color: var(--v4-primary);
}

.v4-settings-btn svg {
    width: 18px;
    height: 18px;
}

/* Icon Button */
.v4-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--v4-text-secondary);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.v4-icon-btn svg {
    width: 20px;
    height: 20px;
}

.v4-icon-btn:hover {
    color: var(--v4-primary);
    border-color: var(--v4-border-base);
}

/* Mobile Menu Button - Hidden on desktop, visible on mobile */
.v4-mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.v4-mobile-menu-btn:hover {
    border-color: var(--v4-primary);
    background: var(--v4-primary-subtle);
}

.v4-hamburger {
    position: relative;
    width: 18px;
    height: 2px;
    background: var(--v4-primary);
}

.v4-hamburger::before,
.v4-hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--v4-primary);
    transition: transform 0.3s ease;
}

.v4-hamburger::before { top: -6px; }
.v4-hamburger::after { bottom: -6px; }

/* Transmission Line */
.v4-transmission-line {
    position: relative;
    height: 2px;
    background: var(--v4-border-dim);
    overflow: hidden;
}

.v4-transmission-pulse {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--v4-primary), transparent);
    animation: transmission-pulse 3s linear infinite;
}

@keyframes transmission-pulse {
    0% { left: -100%; }
    100% { left: 100%; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE DRAWER (Theme & Nav Menu) - Only visible on mobile
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: var(--v4-bg-panel);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.v4-mobile-drawer.active {
    transform: translateY(0);
}

.v4-mobile-drawer-content {
    display: flex;
    flex-direction: column;
    padding: calc(60px + var(--v4-space-6)) var(--v4-space-6) var(--v4-space-6);
    gap: var(--v4-space-2);
}

.v4-mobile-link {
    display: block;
    padding: var(--v4-space-4);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-md);
    font-weight: 600;
    letter-spacing: var(--v4-tracking-wide);
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    transition: all 0.2s ease;
}

.v4-mobile-link.active,
.v4-mobile-link:hover {
    color: var(--v4-primary);
    background: var(--v4-primary-subtle);
    border-color: var(--v4-border-base);
}

.v4-mobile-divider {
    height: 1px;
    margin: var(--v4-space-4) 0;
    background: var(--v4-border-dim);
}

.v4-mobile-themes {
    display: flex;
    flex-direction: column;
    gap: var(--v4-space-3);
}

.v4-mobile-section-label {
    color: var(--v4-text-muted);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-xs);
    font-weight: 600;
    letter-spacing: var(--v4-tracking-wide);
    text-transform: uppercase;
    padding: var(--v4-space-1) 0;
}

.v4-mobile-themes-label {
    color: var(--v4-text-muted);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    letter-spacing: var(--v4-tracking-wide);
    text-transform: uppercase;
}

.v4-mobile-themes .v4-theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--v4-space-2);
    padding: var(--v4-space-3);
    border-radius: var(--v4-radius-md);
    background: var(--v4-bg-surface);
}

.v4-mobile-themes .v4-theme-btn {
    width: 100%;
    gap: var(--v4-space-2);
    padding: var(--v4-space-2) var(--v4-space-3);
    border-radius: var(--v4-radius-md);
    justify-content: flex-start;
}

.v4-mobile-themes .v4-theme-btn span:last-child {
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    color: var(--v4-text-secondary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-main {
    max-width: var(--v4-max-width);
    margin: 0 auto;
    padding: var(--v4-space-6);
}


/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-header {
    text-align: center;
    margin-bottom: var(--v4-space-8);
    padding: var(--v4-space-8) 0;
}

.v4-header-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-1) var(--v4-space-3);
    margin-bottom: var(--v4-space-4);
    color: var(--v4-accent-green);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-xs);
    font-weight: 600;
    letter-spacing: var(--v4-tracking-widest);
    text-transform: uppercase;
    background: rgba(51, 204, 51, 0.1);
    border: 1px solid rgba(51, 204, 51, 0.3);
    border-radius: var(--v4-radius-full);
}

.v4-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--v4-accent-green);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.v4-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--v4-space-1);
    margin-bottom: var(--v4-space-4);
}

.v4-title-line1,
.v4-title-line2 {
    font-family: var(--v4-font-display);
    font-weight: 800;
    letter-spacing: var(--v4-tracking-wider);
    line-height: var(--v4-leading-tight);
}

.v4-title-line1 {
    font-size: var(--v4-text-xl);
    color: var(--v4-text-secondary);
}

.v4-title-line2 {
    font-size: var(--v4-text-4xl);
    color: var(--v4-primary);
    text-shadow: var(--v4-glow-text);
}

.v4-subtitle {
    max-width: 500px;
    margin: 0 auto;
    color: var(--v4-text-muted);
    font-size: var(--v4-text-md);
}


/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animations to sections */
.v4-mode-content.active {
    animation: fadeIn 0.3s ease;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
    .v4-navbar,
    .v4-control-panel,
    .v4-settings-panel,
    .v4-mode-selector,
    .v4-toast-container {
        display: none !important;
    }
    
    .v4-body {
        background: white !important;
        color: black !important;
    }
    
    .v4-panel,
    .v4-reference {
        border: 1px solid #ccc !important;
    }
}



/* ══════════════════════════════════════════════════════════════════
   SHARE & EMBED SECTION — Two-card layout (NetYogi-style)
   ══════════════════════════════════════════════════════════════════ */

.v4-share-embed {
    margin-top: 1.5rem;
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-base);
    border-radius: var(--v4-radius-xl);
    padding: 1.25rem;
}

.v4-share-embed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 700px) {
    .v4-share-embed-grid {
        grid-template-columns: 1fr;
    }
}

/* Card base */
.v4-share-card {
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}

.v4-share-card-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--v4-radius-lg);
    background: var(--v4-primary);
    color: var(--v4-bg-darkest);
    margin-bottom: 0.15rem;
}

.v4-share-card-badge svg {
    width: 20px;
    height: 20px;
}

.v4-share-card-title {
    font-family: var(--v4-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--v4-text-primary);
    margin: 0;
    letter-spacing: 0.02em;
}

.v4-share-card-desc {
    font-size: 0.78rem;
    color: var(--v4-text-muted);
    margin: 0 0 0.35rem 0;
    line-height: 1.4;
}

/* ── Share URL row ── */
.v4-share-url-row {
    display: flex;
    width: 100%;
    max-width: 340px;
    border: 1px solid var(--v4-border-base);
    border-radius: var(--v4-radius-full);
    overflow: hidden;
    background: var(--v4-bg-base);
}

.v4-share-url-input {
    flex: 1;
    border: none;
    padding: 0.45rem 0.85rem;
    font-family: var(--v4-font-mono);
    font-size: 0.75rem;
    color: var(--v4-text-primary);
    background: transparent;
    min-width: 0;
    outline: none;
}

.v4-share-url-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.85rem;
    background: var(--v4-primary);
    color: var(--v4-bg-darkest);
    border: none;
    font-family: var(--v4-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0 var(--v4-radius-full) var(--v4-radius-full) 0;
    transition: opacity 0.15s;
}

.v4-share-url-copy:hover {
    opacity: 0.85;
}

.v4-share-url-copy.v4-btn-copied {
    background: #22c55e;
}

/* ── Social row ── */
.v4-share-social-row {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.v4-share-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--v4-border-base);
    background: var(--v4-bg-base);
    color: var(--v4-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.v4-share-social-btn svg {
    width: 16px;
    height: 16px;
}

.v4-share-social-btn:hover {
    background: var(--v4-primary);
    color: var(--v4-bg-darkest);
    border-color: var(--v4-primary);
}

/* ── Embed card action buttons ── */
.v4-share-card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.35rem;
    width: 100%;
    max-width: 300px;
}

.v4-share-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--v4-radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}



/* ══════════════════════════════════════════════════════════════════
   EMBED MODALS (shared base for Get Code + Preview)
   ══════════════════════════════════════════════════════════════════ */

.v4-embed-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.v4-embed-modal-overlay.active {
    display: flex;
}

.v4-embed-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.v4-embed-modal-wide {
    max-width: 900px;
}

.v4-embed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.v4-embed-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.v4-embed-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #666;
    border-radius: 4px;
    transition: background 0.15s;
}

.v4-embed-modal-close:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

.v4-embed-modal-close svg {
    width: 20px;
    height: 20px;
}

.v4-embed-modal-body {
    overflow-y: auto;
    padding: 1.25rem;
}



/* ══════════════════════════════════════════════════════════════════
   GET CODE MODAL — Config options + code output
   ══════════════════════════════════════════════════════════════════ */

.v4-embed-config {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.v4-embed-config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .v4-embed-config-row {
        grid-template-columns: 1fr;
    }
}

.v4-embed-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.v4-embed-label {
    font-family: var(--v4-font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.v4-embed-select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #1a1a1a;
    background: #fff;
}

/* Checkboxes */
.v4-embed-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
}

@media (max-width: 480px) {
    .v4-embed-checkboxes {
        grid-template-columns: 1fr;
    }
}

.v4-embed-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
    user-select: none;
}

.v4-embed-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.v4-checkbox-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.v4-embed-checkbox input:checked + .v4-checkbox-mark {
    background: var(--v4-primary, #d97706);
    border-color: var(--v4-primary, #d97706);
}

.v4-embed-checkbox input:checked + .v4-checkbox-mark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.v4-embed-checkbox input:focus-visible + .v4-checkbox-mark {
    outline: 2px solid var(--v4-primary, #d97706);
    outline-offset: 2px;
}

.v4-embed-checkbox small {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Code Output */
.v4-embed-code-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.v4-embed-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.v4-embed-code-label {
    font-family: var(--v4-font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.v4-btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.v4-btn-copied {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #fff !important;
}

.v4-embed-code-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    min-height: 100px;
}

.v4-embed-code-block code {
    font-family: var(--v4-font-mono, 'SF Mono', 'Fira Code', monospace);
    font-size: 0.78rem;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-all;
}



/* ══════════════════════════════════════════════════════════════════
   PREVIEW MODAL — Blog simulation
   ══════════════════════════════════════════════════════════════════ */

.v4-embed-preview-blog {
    max-width: 100%;
    margin: 0 auto;
}

.embed-preview-article {
    font-family: Georgia, 'Times New Roman', serif;
    color: #333;
    line-height: 1.7;
}



/* ══════════════════════════════════════════════════════════════════
   EMBED PLAYGROUND MODAL — Fullscreen with settings sidebar
   ══════════════════════════════════════════════════════════════════ */

.v4-embed-modal-playground {
    width: 90vw;
    max-width: 90vw;
    height: 85vh;
    max-height: 85vh;
}

.v4-embed-modal-body-playground {
    padding: 0;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.v4-embed-modal-body-playground .v4-embed-preview-blog {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Playground Layout */
.v4-playground-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.v4-playground-sidebar {
    width: 240px;
    min-width: 240px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v4-playground-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
}

.v4-playground-sidebar-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.v4-playground-sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.v4-playground-hint {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.v4-playground-hint strong {
    color: #374151;
}

/* Playground Option Groups */
.v4-playground-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.v4-playground-label {
    font-family: var(--v4-font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.v4-playground-select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #1a1a1a;
    background: #fff;
}

.v4-playground-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v4-playground-checkboxes .v4-embed-checkbox {
    font-size: 0.8rem;
}

/* Preview Area */
.v4-playground-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #e5e7eb;
}

.v4-playground-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.v4-playground-preview-label {
    font-family: var(--v4-font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #6b7280;
}

.v4-playground-preview-theme-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.v4-playground-preview-theme-badge.light {
    background: #fef3c7;
    color: #92400e;
}

.v4-playground-preview-theme-badge.dark {
    background: #1f2937;
    color: #d1d5db;
}

.v4-playground-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

/* Theme-aware preview background */
.v4-playground-preview-area[data-theme-mode="light"] {
    background: #ffffff;
}

.v4-playground-preview-area[data-theme-mode="dark"] {
    background: #1a1a1a;
}

.v4-playground-iframe-wrapper {
    width: 100%;
    transition: max-width 0.3s ease;
}

.v4-playground-iframe {
    width: 100%;
    min-height: 450px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: transparent;
}

.v4-playground-preview-area[data-theme-mode="dark"] .v4-playground-iframe {
    border-color: #374151;
}

.v4-playground-attribution {
    text-align: center;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.v4-playground-attribution a {
    font-size: 0.7rem;
    color: #9ca3af;
    text-decoration: none;
}

.v4-playground-attribution a:hover {
    text-decoration: underline;
}

/* Mobile: Stack sidebar on top */
@media (max-width: 768px) {
    .v4-embed-modal-playground {
        width: 95vw;
        max-width: 95vw;
        height: 90vh;
        max-height: 90vh;
    }

    .v4-playground-layout {
        flex-direction: column;
    }

    .v4-playground-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .v4-playground-sidebar-body {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .v4-playground-option-group {
        flex: 1;
        min-width: 140px;
    }

    .v4-playground-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .v4-playground-sidebar-footer {
        display: none;
    }

    .v4-playground-preview-area {
        padding: 1rem;
    }
}



/* ══════════════════════════════════════════════════════════════════
   PLAYGROUND BLOG SIMULATION — Article styling
   ══════════════════════════════════════════════════════════════════ */

.v4-playground-blog-container {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    transition: background-color 0.3s ease;
}

.v4-playground-blog-container[data-theme-mode="dark"] {
    background: #0d0d0d;
}

.v4-playground-blog-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.8;
    color: #1f2937;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-article {
    color: #e5e7eb;
}

.v4-playground-blog-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-title {
    color: #f9fafb;
}

.v4-playground-blog-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-meta {
    color: #9ca3af;
    border-bottom-color: #374151;
}

.v4-playground-blog-text {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: #374151;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-text {
    color: #d1d5db;
}

.v4-playground-blog-heading,
.v4-playground-blog-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: #111827;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-heading,
.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-blog-subtitle {
    color: #f9fafb;
}

/* Embed container within blog */
.v4-playground-embed-container {
    margin: 2rem 0;
    transition: max-width 0.3s ease;
}

.v4-playground-embed-container.width-full {
    max-width: 100%;
}

.v4-playground-embed-container.width-700 {
    max-width: 700px;
}

.v4-playground-embed-container.width-600 {
    max-width: 600px;
}

.v4-playground-embed-container.width-500 {
    max-width: 500px;
}

.v4-playground-embed-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-embed-wrapper {
    border-color: #374151;
}

.v4-playground-embed-iframe,
.v4-playground-iframe {
    width: 100%;
    min-height: 520px;
    border: none;
    display: block;
}

.v4-playground-embed-attribution {
    text-align: center;
    padding: 0.6rem 0;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.v4-playground-blog-container[data-theme-mode="dark"] .v4-playground-embed-attribution {
    background: #111827;
    border-top-color: #374151;
}

.v4-playground-embed-attribution a {
    font-size: 0.72rem;
    color: #6b7280;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.v4-playground-embed-attribution a:hover {
    text-decoration: underline;
    color: #3b82f6;
}

/* Mobile blog styles */
@media (max-width: 768px) {
    .v4-playground-blog-article {
        padding: 1.25rem 1rem 2rem;
    }

    .v4-playground-blog-title {
        font-size: 1.5rem;
    }

    .v4-playground-blog-text {
        font-size: 0.95rem;
    }

    .v4-playground-embed-container {
        margin: 1.5rem 0;
    }
}



/* ═══════════════════════════════════════════════════════════════════════════
   V4 FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-footer {
    position: relative;
    margin-top: var(--v4-space-16);
    padding: var(--v4-space-12) var(--v4-space-6) var(--v4-space-8);
    background: var(--v4-bg-darker);
    border-top: 1px solid var(--v4-border-dim);
}

.v4-footer-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--v4-primary-dim) 25%,
        var(--v4-primary) 50%,
        var(--v4-primary-dim) 75%,
        transparent 100%
    );
    opacity: 0.6;
}

.v4-footer-container {
    max-width: var(--v4-max-width);
    margin: 0 auto;
}

/* Footer grid */
.v4-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--v4-space-10);
    margin-bottom: var(--v4-space-10);
}

@media (max-width: 768px) {
    .v4-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--v4-space-8) var(--v4-space-6);
    }
}

@media (max-width: 480px) {
    .v4-footer-grid {
        grid-template-columns: 1fr;
        gap: var(--v4-space-8);
    }
}

/* Brand column */
.v4-footer-brand {
    max-width: 320px;
}

@media (max-width: 768px) {
    .v4-footer-brand {
        grid-column: 1 / -1;
        max-width: none;
    }
}

.v4-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--v4-space-3);
    text-decoration: none;
    color: var(--v4-primary);
    margin-bottom: var(--v4-space-4);
}

.v4-footer-brand-text {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-md);
    font-weight: 700;
    letter-spacing: var(--v4-tracking-wider);
    color: var(--v4-primary);
    text-shadow: var(--v4-glow-text);
}

.v4-footer-brand-accent {
    color: var(--v4-text-primary);
    font-weight: 500;
}

.v4-footer-tagline {
    font-size: var(--v4-text-base);
    color: var(--v4-text-muted);
    line-height: var(--v4-leading-relaxed);
    margin-bottom: var(--v4-space-4);
}

.v4-footer-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-1) var(--v4-space-3);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-full);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-xs);
    color: var(--v4-accent-green);
    letter-spacing: var(--v4-tracking-wide);
}

.v4-footer-privacy-dot {
    width: 6px;
    height: 6px;
    background: var(--v4-accent-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--v4-accent-green);
}

/* Nav columns */
.v4-footer-nav {
    min-width: 0;
}

.v4-footer-heading {
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--v4-tracking-wider);
    color: var(--v4-text-muted);
    margin: 0 0 var(--v4-space-4) 0;
}

.v4-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.v4-footer-links li {
    margin-bottom: var(--v4-space-2);
}

.v4-footer-links a {
    color: var(--v4-text-secondary);
    text-decoration: none;
    font-size: var(--v4-text-base);
    transition: color 0.2s ease;
}

.v4-footer-links a:hover {
    color: var(--v4-primary);
}

/* Bottom bar */
.v4-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--v4-space-4);
    padding-top: var(--v4-space-6);
    border-top: 1px solid var(--v4-border-dim);
}

.v4-footer-copy {
    font-size: var(--v4-text-sm);
    color: var(--v4-text-muted);
    margin: 0;
}

.v4-footer-copy a {
    color: var(--v4-primary);
    text-decoration: none;
}

.v4-footer-copy a:hover {
    text-decoration: underline;
}

.v4-footer-socials {
    display: flex;
    gap: var(--v4-space-2);
}

.v4-footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-md);
    color: var(--v4-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.v4-footer-social:hover {
    border-color: var(--v4-primary);
    color: var(--v4-primary);
    background: var(--v4-primary-subtle);
}

.v4-footer-social svg {
    width: 18px;
    height: 18px;
}



/* ═══════════════════════════════════════════════════════════════════════════
   V4 NAV DROPDOWNS (Learn — used in shared navbar)
   ═══════════════════════════════════════════════════════════════════════════ */
.v4-nav-dropdown {
    position: relative;
}

.v4-nav-dropdown-trigger {
    /* Reset button defaults to match <a> nav links */
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 1px solid transparent;
    font: inherit;
    color: inherit;
    line-height: inherit;
    cursor: pointer;
}

.v4-nav-dropdown-trigger .v4-dropdown-arrow {
    transition: transform 0.2s ease;
}

.v4-nav-dropdown.open .v4-nav-dropdown-trigger .v4-dropdown-arrow {
    transform: rotate(180deg);
}

.v4-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: var(--v4-bg-panel);
    border: 1px solid var(--v4-border-base);
    border-radius: var(--v4-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
    padding: var(--v4-space-2);
}

.v4-nav-dropdown.open .v4-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.v4-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    padding: var(--v4-space-2) var(--v4-space-3);
    color: var(--v4-text-secondary);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-sm);
    text-decoration: none;
    border-radius: var(--v4-radius-sm);
    transition: all 0.15s ease;
}

.v4-nav-dropdown-item:hover {
    background: var(--v4-primary-subtle);
    color: var(--v4-primary);
}

.v4-nav-dropdown-icon {
    font-size: var(--v4-text-md);
    line-height: 1;
}

