/* ============================================================================
   GX Outreach Editor — shared component styles
   ----------------------------------------------------------------------------
   Used by /venue-outreach-templates. Self-contained, relies only on CSS
   variables from sb-shared.css (tokens, spacing, radii, fonts).
   All class names prefixed with .gxo- for the "GigXchange Outreach" namespace.
   ============================================================================ */

.gxo-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--sb-space-xl);
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Left column: controls (stepper journey, no sticky — preview is sticky instead) ── */
.gxo-controls {
    display: flex; flex-direction: column; gap: var(--sb-space-lg);
    padding: 0;
    position: relative;
}

/* ── Step wrapper: transparent container — heading floats above, only the body is a card ── */
.gxo-step {
    position: relative;
    display: flex; flex-direction: column; gap: var(--sb-space-md);
    padding: 0; border: none; background: transparent;
}
/* Connector line removed — gradient numerals stacked vertically already carry the journey visually */

.gxo-step-head {
    display: flex; align-items: flex-start; gap: 14px;
}
/* Canonical site step-number pattern: big Rajdhani numeral, gradient-clipped text, no circle
   (matches .vo-step-num on venue-outreach-templates.html and .idx-step-n on /rates/).
   All step numerals share the same ice → violet gradient for visual consistency. */
.gxo-step-num {
    flex-shrink: 0;
    font-family: 'Rajdhani', var(--sb-font);
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--sb-ice); /* fallback for clients that ignore background-clip:text */
    background: linear-gradient(135deg, var(--sb-ice), var(--sb-violet));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 48px;
    display: inline-block;
}
.gxo-step-titles {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0; flex: 1;
}
.gxo-step-title {
    margin: 0;
    font-family: 'Rajdhani', var(--sb-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sb-text-primary);
    letter-spacing: -0.005em;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.gxo-step-optional {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(var(--sb-violet-rgb, 99,102,241), 0.12);
    color: #A5B4FC;
    border: 1px solid rgba(var(--sb-violet-rgb, 99,102,241), 0.35);
}
.gxo-step-sub {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--sb-text-muted);
}
.gxo-step-body {
    display: flex; flex-direction: column; gap: var(--sb-space-sm);
    padding: var(--sb-space-lg);
    border-radius: var(--sb-radius-lg);
    background: linear-gradient(var(--sb-card-fill), var(--sb-card-fill)) padding-box, var(--sb-gradient) border-box;
    border: 1px solid transparent;
    transition: box-shadow 0.25s ease;
}
.gxo-step:hover .gxo-step-body {
    box-shadow: 0 6px 24px -10px rgba(var(--sb-ice-rgb), 0.25);
}

/* Template picker cards — 3 across on wider layouts now that we have full width */
.gxo-template-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 760px) { .gxo-template-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gxo-template-grid { grid-template-columns: 1fr; } }
.gxo-template-card {
    appearance: none; -webkit-appearance: none;
    text-align: left;
    padding: 14px;
    background: rgba(var(--sb-ice-rgb), 0.03);
    border: 1px solid rgba(var(--sb-ice-rgb), 0.22);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; flex-direction: column; gap: 4px;
    font-family: var(--sb-font);
    color: var(--sb-text-secondary);
    min-height: 74px;
}
.gxo-template-card:hover {
    border-color: rgba(var(--sb-ice-rgb), 0.45);
    background: rgba(var(--sb-ice-rgb), 0.05);
    color: var(--sb-text-primary);
    transform: translateY(-1px);
}
.gxo-template-card.active {
    background: rgba(var(--sb-ice-rgb), 0.10);
    border-color: var(--sb-ice);
    color: var(--sb-ice);
    box-shadow: 0 0 0 3px rgba(var(--sb-ice-rgb), 0.08);
}
.gxo-template-name { font-size: 0.92rem; font-weight: 700; }
.gxo-template-desc { font-size: 0.76rem; color: var(--sb-text-muted); line-height: 1.45; }
.gxo-template-card.active .gxo-template-desc { color: rgba(255,255,255,0.7); }

/* Tone toggle */
.gxo-tone-toggle {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--sb-border);
    border-radius: 10px;
    padding: 4px;
}
.gxo-tone-btn {
    appearance: none; -webkit-appearance: none;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-family: var(--sb-font);
    font-size: 0.85rem; font-weight: 600;
    color: var(--sb-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.gxo-tone-btn:hover { color: var(--sb-text-primary); }
.gxo-tone-btn.active {
    background: rgba(var(--sb-ice-rgb), 0.14);
    color: var(--sb-ice);
    box-shadow: 0 0 0 1px rgba(var(--sb-ice-rgb), 0.3);
}

/* Accent swatches */
.gxo-accent-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gxo-accent-swatch {
    appearance: none; -webkit-appearance: none;
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--swatch);
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px var(--sb-border);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.gxo-accent-swatch:hover { transform: scale(1.1); }
.gxo-accent-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--swatch), 0 0 12px var(--swatch);
}

/* Fields — 3-col grid now that the step spans the full page */
.gxo-fields {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 760px) { .gxo-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gxo-fields { grid-template-columns: 1fr; } }
.gxo-field { display: flex; flex-direction: column; gap: 4px; }
.gxo-field-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sb-text-muted);
    font-weight: 600;
}
.gxo-input {
    appearance: none; -webkit-appearance: none;
    padding: 9px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    color: var(--sb-text-primary);
    font-family: var(--sb-font);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}
.gxo-input:hover { border-color: rgba(var(--sb-ice-rgb), 0.4); }
.gxo-input:focus {
    outline: none;
    border-color: var(--sb-ice);
    background: rgba(var(--sb-ice-rgb), 0.04);
    box-shadow: 0 0 0 3px rgba(var(--sb-ice-rgb), 0.12);
}

/* ── Branding grid: 5 slots (Logo | Avatar | Photo 1 | Photo 2 | Photo 3).
   minmax(0, 1fr) forces every column to take exactly 1/5 of the container
   regardless of internal content — so a long filename can't widen its card.
   Wraps to fewer columns on narrower breakpoints. ── */
.gxo-branding-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 960px) { .gxo-branding-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .gxo-branding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .gxo-branding-grid { grid-template-columns: minmax(0, 1fr); } }
/* Filename must not push column width — it's already nowrap+ellipsis in the
   base .gxo-upload-filename rule, but reinforce max-width here for safety. */
.gxo-branding-grid .gxo-upload-filename { max-width: 100%; }

.gxo-brand-col {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(var(--sb-ice-rgb), 0.03);
    border: 1px solid rgba(var(--sb-ice-rgb), 0.22);
}
.gxo-brand-col-head { display: flex; flex-direction: column; gap: 2px; }
.gxo-brand-col-title {
    font-family: 'Rajdhani', var(--sb-font);
    font-size: 0.95rem; font-weight: 700;
    color: var(--sb-text-primary);
    letter-spacing: 0.01em;
}
.gxo-brand-col-sub {
    font-size: 0.72rem;
    color: var(--sb-text-muted);
    letter-spacing: 0.04em;
}

/* Upload drop zones (logo + avatar) */
.gxo-upload-drop {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 12px;
    border: 1px dashed rgba(var(--sb-ice-rgb), 0.4);
    border-radius: 8px;
    background: rgba(var(--sb-ice-rgb), 0.04);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.gxo-upload-drop:has(.gxo-upload-preview.is-filled) {
    border-style: solid;
    border-color: rgba(var(--sb-ice-rgb), 0.35);
    background: rgba(var(--sb-ice-rgb), 0.06);
}
.gxo-upload-preview {
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(var(--sb-ice-rgb), 0.2);
    color: rgba(var(--sb-ice-rgb), 0.6);
    overflow: hidden;
    flex-shrink: 0;
}
.gxo-upload-preview svg { width: 28px; height: 28px; }
.gxo-upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gxo-upload-preview--circle { border-radius: 50%; }
.gxo-upload-preview.is-filled {
    background: #0C1120;
    border-color: var(--sb-ice);
    box-shadow: 0 0 0 2px rgba(var(--sb-ice-rgb), 0.2);
}
.gxo-upload-filename {
    font-size: 0.74rem;
    color: var(--sb-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
}
/* Single toggle button — reads "Choose file" when empty, "Remove" when filled */
.gxo-upload-btn {
    appearance: none; -webkit-appearance: none;
    padding: 6px 14px;
    background: rgba(var(--sb-ice-rgb), 0.15);
    border: 1px solid rgba(var(--sb-ice-rgb), 0.4);
    border-radius: 6px;
    color: var(--sb-ice);
    font-family: var(--sb-font);
    font-size: 0.78rem; font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gxo-upload-btn:hover { background: rgba(var(--sb-ice-rgb), 0.22); border-color: var(--sb-ice); }
.gxo-upload-btn--remove {
    background: rgba(var(--sb-fuchsia-rgb, 236,72,153), 0.12);
    border-color: rgba(var(--sb-fuchsia-rgb, 236,72,153), 0.4);
    color: #F0ABFC;
}
.gxo-upload-btn--remove:hover { background: rgba(var(--sb-fuchsia-rgb, 236,72,153), 0.22); border-color: #F0ABFC; }

/* ── Preview: transparent container — step-head floats above, only the body is a card ── */
.gxo-preview-col {
    display: flex; flex-direction: column; gap: var(--sb-space-md);
    padding: 0; border: none; background: transparent;
}

/* Subject bar — top strip inside the preview shell, flush with the card edge,
   divider below to separate from canvas */
.gxo-subject-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 2px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(var(--sb-ice-rgb), 0.12);
    margin-bottom: -2px;
}
.gxo-subject-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sb-text-muted);
    font-weight: 700;
    white-space: nowrap;
}
.gxo-subject-value {
    flex: 1;
    color: var(--sb-text-primary);
    font-family: var(--sb-font);
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.gxo-mini-btn {
    appearance: none; -webkit-appearance: none;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: rgba(var(--sb-ice-rgb), 0.10);
    border: 1px solid rgba(var(--sb-ice-rgb), 0.35);
    border-radius: 6px;
    color: var(--sb-ice);
    font-family: var(--sb-font);
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.gxo-mini-btn:hover { background: rgba(var(--sb-ice-rgb), 0.18); }
.gxo-mini-btn svg { width: 13px; height: 13px; }
.gxo-mini-btn.is-flashed {
    background: rgba(var(--sb-fuchsia-rgb, 236,72,153), 0.18);
    border-color: var(--sb-fuchsia, #EC4899);
    color: #F0ABFC;
}

/* The email preview canvas — GigXchange-branded dark email on #080C14 bg.
   Matches the canonical branded email in supabase/functions/auto-outreach.
   Shell is the card body — step-head floats above it (same pattern as .gxo-step). */
.gxo-preview-shell {
    display: flex; flex-direction: column; gap: var(--sb-space-md);
    padding: var(--sb-space-lg);
    border-radius: var(--sb-radius-lg);
    background: linear-gradient(var(--sb-card-fill), var(--sb-card-fill)) padding-box, var(--sb-gradient) border-box;
    border: 1px solid transparent;
    transition: box-shadow 0.25s ease;
}
.gxo-preview-col:hover .gxo-preview-shell {
    box-shadow: 0 6px 24px -10px rgba(var(--sb-ice-rgb), 0.25);
}
.gxo-preview-canvas {
    background: #080C14;
    border-radius: var(--sb-radius-md);
    padding: 0;
    min-height: 360px;
    flex: 1 1 auto;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--sb-ice-rgb), 0.3) transparent;
}
.gxo-preview-canvas::-webkit-scrollbar { width: 6px; }
.gxo-preview-canvas::-webkit-scrollbar-thumb { background: rgba(var(--sb-ice-rgb), 0.25); border-radius: 3px; }
.gxo-preview-canvas table { margin: 0 auto; }

/* Export row — bottom strip inside the preview shell, flush with the card edge,
   divider above to separate from canvas */
.gxo-export-row {
    display: flex; flex-wrap: wrap; gap: 10px;
    justify-content: center;
    padding: 14px 2px 2px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(var(--sb-ice-rgb), 0.12);
    margin-top: -2px;
}
.gxo-export-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px !important;
    font-size: 0.88rem !important;
}
.gxo-export-btn svg { width: 16px; height: 16px; }
.gxo-export-btn.is-flashed {
    background: rgba(var(--sb-fuchsia-rgb, 236,72,153), 0.22) !important;
    border-color: var(--sb-fuchsia, #EC4899) !important;
    color: #F0ABFC !important;
}

.gxo-export-hint {
    margin: 0;
    padding: 12px 16px;
    border-left: 3px solid var(--sb-ice);
    background: rgba(var(--sb-ice-rgb), 0.05);
    border-radius: 0 var(--sb-radius-md) var(--sb-radius-md) 0;
    color: var(--sb-text-secondary);
    font-size: 0.85rem;
    line-height: 1.55;
}
.gxo-export-hint strong { color: var(--sb-ice); }
