/* ============================================================================
   Embed Widget — Code Generator Dialog Styles
   ============================================================================ */

.embed-widget-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100% - 44px);
}

/* Intro */
.embed-intro p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
    margin: 0;
}

/* Section Titles */
.embed-section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Config Grid */
.embed-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.embed-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.embed-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.embed-field-help {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    line-height: 1.4;
    font-style: italic;
    background: rgba(14, 165, 233, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 2px solid #0ea5e9;
}

.embed-input,
.embed-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.embed-input:focus,
.embed-select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.embed-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: embed-shake 0.3s ease-in-out;
}

@keyframes embed-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.embed-select option {
    background: #1e293b;
    color: #f8fafc;
}

/* Color Picker */
.embed-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.embed-color-picker {
    width: 40px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.embed-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.embed-color-picker::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.embed-color-hex {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    opacity: 0.7;
}

/* Toggles */
.embed-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.embed-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.embed-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0ea5e9;
    cursor: pointer;
}

/* Preview */
.embed-preview-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.embed-preview-frame {
    width: 100%;
    height: 320px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.embed-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 13px;
    opacity: 0.4;
    text-align: center;
    padding: 20px;
}

/* Code Output */
.embed-code-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.embed-code-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
}

.embed-tab {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.embed-tab:first-child {
    border-radius: 8px 0 0 8px;
}

.embed-tab:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.embed-tab.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
    color: #38bdf8;
}

.embed-code-box {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
}

.embed-code-box pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    max-height: 220px;
}

.embed-code-text {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #a5f3fc;
    white-space: pre-wrap;
    word-break: break-all;
}

.embed-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.9);
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.embed-copy-btn:hover {
    background: rgba(14, 165, 233, 0.3);
    border-color: rgba(14, 165, 233, 0.5);
}

/* Platform Instructions */
.embed-platform-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.embed-platform {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}

.embed-platform summary {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    transition: background 0.2s;
}

.embed-platform summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.embed-platform[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.embed-platform-body {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}

.embed-platform-body ol {
    margin: 4px 0;
    padding-left: 20px;
}

.embed-platform-body li {
    margin-bottom: 4px;
}

.embed-platform-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

.embed-platform-body em {
    opacity: 0.7;
}

/* Action Buttons */
.embed-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 8px;
}

.embed-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.embed-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.embed-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.embed-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.embed-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(14, 165, 233, 0.4);
}

.embed-btn-primary:active {
    transform: translateY(0);
}

/* ============================================================================
   Light Theme overrides (when parent applies light theme class)
   ============================================================================ */
[data-theme="light"] .embed-widget-content .embed-input,
[data-theme="light"] .embed-widget-content .embed-select {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .embed-code-text {
    color: #0369a1;
}

[data-theme="light"] .embed-code-box,
[data-theme="light"] .embed-preview-frame {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .embed-copy-btn {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

[data-theme="light"] .embed-select option {
    background: #ffffff;
    color: #1e293b;
}
