/* VCM Widget CSS — standalone embed stylesheet */
.xmla-widget-wrapper {
    --w-primary: #00d4ff;
    --w-bg: #111827;
    --w-card: rgba(255,255,255,0.06);
    --w-border: rgba(0,212,255,0.2);
    --w-text: #f9fafb;
    --w-muted: #9ca3af;
    --w-success: #10b981;
    --w-danger: #ef4444;
    --w-radius: 16px;
    --w-btn-radius: 50px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
}

.xmla-widget-wrapper *, .xmla-widget-wrapper *::before, .xmla-widget-wrapper *::after {
    box-sizing: border-box;
}

/* SVG Icons */
.xmla-icon-mic {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
}

.xmla-icon-video {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Launcher Button */
.xmla-launcher {
    position: fixed;
    z-index: 9998;
    bottom: 24px;
    right: 24px;
}

.xmla-launcher.pos-bottom-left   { bottom: 24px; right: auto; left: 24px; }
.xmla-launcher.pos-top-right     { bottom: auto; top: 24px; right: 24px; }
.xmla-launcher.pos-top-left      { bottom: auto; top: 24px; right: auto; left: 24px; }

.xmla-launcher-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--w-primary), #0050ff);
    color: #fff;
    border: none;
    border-radius: var(--w-btn-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
    white-space: nowrap;
}

.xmla-launcher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.xmla-launcher-icon { font-size: 18px; }
.xmla-launcher-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--w-success);
    border-radius: 50%;
    border: 2px solid var(--w-bg);
}

.xmla-launcher-pulse::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: var(--w-success);
    border-radius: 50%;
    opacity: 0.4;
    animation: xmla-w-pulse 2s infinite;
}

@keyframes xmla-w-pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* Panel */
.xmla-panel {
    position: fixed;
    z-index: 9999;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-height: 85vh;
    background: var(--w-bg);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: xmla-w-slide-up 0.25s ease;
    backdrop-filter: blur(20px);
}

.xmla-panel.open { display: flex; }
.xmla-panel.pos-bottom-left  { right: auto; left: 24px; }
.xmla-panel.pos-top-right    { bottom: auto; top: 90px; }
.xmla-panel.pos-top-left     { bottom: auto; top: 90px; right: auto; left: 24px; }

@keyframes xmla-w-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.xmla-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,80,255,0.08));
    border-bottom: 1px solid var(--w-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.xmla-panel-title { font-size: 15px; font-weight: 700; color: var(--w-text); }
.xmla-panel-close {
    background: none;
    border: none;
    color: var(--w-muted);
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.xmla-panel-close:hover { background: rgba(255,255,255,0.1); color: var(--w-text); }

.xmla-panel-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-width: 0;
}

/* Steps */
.xmla-step { display: none; min-width: 0; overflow: hidden; }
.xmla-step.active { display: block; }

/* Mode Selector */
.xmla-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.xmla-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: var(--w-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    cursor: pointer;
    color: var(--w-muted);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.xmla-mode-btn:hover {
    border-color: var(--w-primary);
    color: var(--w-text);
}

.xmla-mode-btn.active {
    background: rgba(0,212,255,0.1);
    border-color: var(--w-primary);
    color: var(--w-primary);
}

.xmla-mode-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.xmla-mode-icon { font-size: 24px; }

/* Recording Controls */
.xmla-recorder-area {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.xmla-video-preview {
    width: 100%;
    max-height: 160px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: none;
    background: #000;
    object-fit: cover;
}

.xmla-video-preview.visible { display: block; }

.xmla-audio-visualizer {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 12px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.xmla-audio-visualizer.active {
    opacity: 1;
}

.xmla-audio-bar {
    width: 3px;
    background: var(--w-primary);
    border-radius: 3px;
    height: 3px;
    transition: height 0.06s ease-out;
    will-change: height;
    min-height: 3px;
}

.xmla-timer {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--w-text);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.xmla-timer-limit { font-size: 11px; color: var(--w-muted); margin-bottom: 16px; }

.xmla-rec-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }

.xmla-rec-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.xmla-rec-btn-start {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
    color: #fff;
}

.xmla-rec-btn-start::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    display: block;
}

.xmla-rec-btn-start.recording::after {
    border-radius: 3px;
    width: 14px;
    height: 14px;
}

.xmla-rec-btn-start.recording {
    animation: xmla-w-rec-pulse 1s infinite;
}

@keyframes xmla-w-rec-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 4px 24px rgba(239,68,68,0.7); }
}

.xmla-rec-btn-stop {
    background: rgba(255,255,255,0.08);
    color: var(--w-text);
    border: 1px solid rgba(255,255,255,0.12);
}

.xmla-rec-btn-stop::after {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--w-text);
    border-radius: 2px;
    display: block;
}

.xmla-rec-btn-stop:hover { background: rgba(255,255,255,0.15); }
.xmla-rec-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Recording Actions (Next + Re-record) */
.xmla-rec-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}

/* Playback */
.xmla-playback {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    display: none;
}

.xmla-playback.visible { display: block; }

.xmla-playback audio, .xmla-playback video {
    width: 100%;
    border-radius: 6px;
    outline: none;
}

/* Form Fields */
.xmla-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
    width: 100%;
}

.xmla-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.xmla-form-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--w-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xmla-form-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    padding: 9px 12px;
    color: var(--w-text);
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

.xmla-form-input:focus {
    outline: none;
    border-color: var(--w-primary);
    background: rgba(0,212,255,0.05);
}

.xmla-form-input::placeholder { color: #4b5563; }

.xmla-form-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    padding: 9px 12px;
    color: var(--w-text);
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

/* Honeypot */
.xmla-hp-field { opacity: 0; position: absolute; height: 0; overflow: hidden; pointer-events: none; }

/* Status Messages */
.xmla-status {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    display: none;
    margin-bottom: 12px;
}

.xmla-status.visible { display: block; }
.xmla-status.success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.xmla-status.error   { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* Submit Button */
.xmla-submit-btn {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--w-primary), #0050ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    box-sizing: border-box;
}

.xmla-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.xmla-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Link-style buttons */
.xmla-btn-link {
    background: none;
    border: none;
    color: var(--w-muted);
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 8px;
    font-family: inherit;
    transition: color 0.2s;
}

.xmla-btn-link:hover { color: var(--w-text); }

/* Branding */
.xmla-branding {
    text-align: center;
    padding: 10px 20px 14px;
    font-size: 10px;
    color: var(--w-muted);
    opacity: 0.5;
}

.xmla-branding a { color: var(--w-primary); text-decoration: none; }

/* Watermark */
.xmla-watermark {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
}

/* ── Theme Variants ─────────────────────────────────────────── */
.xmla-theme-glass-light {
    --w-bg: rgba(255,255,255,0.95);
    --w-card: rgba(0,0,0,0.04);
    --w-border: rgba(0,0,0,0.1);
    --w-text: #0f172a;
    --w-muted: #64748b;
}

.xmla-theme-glass-light .xmla-launcher-pulse { border-color: #fff; }
.xmla-theme-glass-light .xmla-panel-close:hover { background: rgba(0,0,0,0.06); }
.xmla-theme-glass-light .xmla-recorder-area { background: rgba(0,0,0,0.04); }
.xmla-theme-glass-light .xmla-playback { background: rgba(0,0,0,0.04); }
.xmla-theme-glass-light .xmla-form-input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #0f172a; }
.xmla-theme-glass-light .xmla-form-input::placeholder { color: #94a3b8; }
.xmla-theme-glass-light .xmla-form-select { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #0f172a; }
.xmla-theme-glass-light .xmla-rec-btn-stop { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }
.xmla-theme-glass-light .xmla-rec-btn-stop::after { background: #0f172a; }
.xmla-theme-glass-light .xmla-mode-btn { border-color: rgba(0,0,0,0.08); }
.xmla-theme-glass-light .xmla-status.success { background: rgba(16,185,129,0.1); color: #059669; border-color: rgba(16,185,129,0.2); }
.xmla-theme-glass-light .xmla-status.error { background: rgba(239,68,68,0.08); color: #dc2626; border-color: rgba(239,68,68,0.15); }

.xmla-theme-minimal-white {
    --w-bg: #ffffff;
    --w-card: #f8fafc;
    --w-border: #e2e8f0;
    --w-text: #1e293b;
    --w-muted: #64748b;
    --w-primary: #1e40af;
}

.xmla-theme-minimal-white .xmla-launcher-pulse { border-color: #fff; }
.xmla-theme-minimal-white .xmla-panel-header { background: #f8fafc; }
.xmla-theme-minimal-white .xmla-panel-close:hover { background: rgba(0,0,0,0.06); }
.xmla-theme-minimal-white .xmla-recorder-area { background: #f1f5f9; }
.xmla-theme-minimal-white .xmla-playback { background: #f1f5f9; }
.xmla-theme-minimal-white .xmla-form-input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
.xmla-theme-minimal-white .xmla-form-input::placeholder { color: #94a3b8; }
.xmla-theme-minimal-white .xmla-form-select { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
.xmla-theme-minimal-white .xmla-rec-btn-stop { background: #f1f5f9; border-color: #e2e8f0; }
.xmla-theme-minimal-white .xmla-rec-btn-stop::after { background: #1e293b; }
.xmla-theme-minimal-white .xmla-mode-btn { border-color: #e2e8f0; }
.xmla-theme-minimal-white .xmla-status.success { background: rgba(16,185,129,0.08); color: #059669; border-color: rgba(16,185,129,0.2); }
.xmla-theme-minimal-white .xmla-status.error { background: rgba(239,68,68,0.06); color: #dc2626; border-color: rgba(239,68,68,0.15); }

.xmla-theme-cyber-blue {
    --w-bg: #000814;
    --w-card: rgba(0,255,255,0.04);
    --w-border: rgba(0,255,255,0.2);
    --w-text: #00ffff;
    --w-muted: #00b4b4;
    --w-primary: #00ffff;
}

.xmla-theme-corporate {
    --w-bg: #1e293b;
    --w-card: rgba(255,255,255,0.05);
    --w-border: rgba(37,99,235,0.3);
    --w-text: #f8fafc;
    --w-muted: #94a3b8;
    --w-primary: #2563eb;
}

.xmla-theme-floating-bubble .xmla-launcher-btn {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    padding: 0;
    justify-content: center;
}

.xmla-theme-floating-bubble .xmla-launcher-btn .xmla-launcher-text { display: none; }
.xmla-theme-floating-bubble .xmla-launcher-icon { font-size: 22px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 440px) {
    .xmla-panel {
        width: calc(100vw - 24px);
        right: 12px !important;
        left: 12px !important;
        bottom: 80px;
    }
    .xmla-panel.pos-top-right,
    .xmla-panel.pos-top-left {
        top: 80px;
        bottom: auto;
    }
}
