/* =============================================================================
   SIC Tank Designer — Design Your Tank — designer.css v3
   Extends dynamic-configurator.css — does NOT override it.
   ============================================================================= */

/* ── VC embed in Step 1 (hide hero, keep everything else) ───────────────── */
.sictd-dyt-app .sictd-vc-hero { display:none !important; }
.sictd-dyt-app .sictd-vc-wrap { padding:0; }

/* ── Viewer col: matrix image fills correctly ────────────────────────────── */
.sictd-dyt-map-inner { position:relative; width:100%; }
.sictd-dyt-map-inner .sictd-tank-base {
    width:100%; height:auto; display:block;
    background:#fff;
    border-radius:8px;
}

/* ── Component overlay (absolute over matrix image) ─────────────────────── */
.sictd-dyt-overlay {
    position:absolute; inset:0;
    pointer-events:none;
    z-index:5;
}
.sictd-dyt-overlay > * { pointer-events:all; }

/* ── Library panel (inside right wizard col in step 3) ──────────────────── */
.sictd-dyt-library-wrap {
    border:1.5px solid var(--sic-border);
    border-radius:var(--sic-r);
    overflow:hidden;
    margin-top:12px;
}
.sictd-dyt-library-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:8px 12px;
    background:var(--sic-light);
    border-bottom:1px solid var(--sic-border);
    font-size:11px; font-weight:700; color:var(--sic-dark);
    letter-spacing:1px; text-transform:uppercase;
}
.sictd-dyt-lib-sub { font-size:9px; color:var(--sic-muted); font-weight:400; }

/* ── Library component cards ─────────────────────────────────────────────── */
.sictd-dyt-lib-list {
    max-height:280px; overflow-y:auto;
}
.sictd-dyt-comp-card {
    display:flex; align-items:center; gap:10px;
    padding:9px 12px;
    border-bottom:1px solid var(--sic-border);
    cursor:grab;
    transition:background .15s;
    user-select:none;
}
.sictd-dyt-comp-card:last-child { border-bottom:none; }
.sictd-dyt-comp-card:hover { background:var(--sic-light); }
.sictd-dyt-comp-card.is-maxed  { opacity:.38; cursor:not-allowed; }
.sictd-dyt-comp-card.is-hidden { display:none; }
.sictd-dyt-comp-card.is-locked { opacity:.3; cursor:not-allowed; filter:grayscale(1); }
.sictd-dyt-comp-icon { width:36px; height:36px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.sictd-dyt-comp-icon img { max-width:34px; max-height:34px; }
.sictd-dyt-comp-info { flex:1; min-width:0; }
.sictd-dyt-comp-name { font-size:12px; font-weight:700; color:var(--sic-dark); }
.sictd-dyt-comp-sub {
    font-size: 10px;
    color: #51585d;
    font-weight: bold;
    margin-top: 2px;
}
.sictd-dyt-comp-count { font-size:10px; color:var(--sic-muted); font-family:monospace; white-space:nowrap; }

/* ── Placed component on overlay ─────────────────────────────────────────── */
.sictd-dyt-placed {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 10;
    overflow: visible;
    transform-origin: center center;
}
.sictd-dyt-placed.confirmed { cursor:pointer; }

/* ── Confirm button: small circle top-right ──────────────────────────────── */
.sictd-dyt-confirm-btn {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border-radius: 50% !important;
    background: #dc2626;
    color: #fff !important;
    border: 1.5px solid #fff !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    z-index: 30 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    pointer-events: all !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.35) !important;
    transition: background 0.2s;
}
.sictd-dyt-confirm-btn.gear-confirmed {
    background: #16a34a !important;
}
.sictd-dyt-confirm-btn:hover { transform:scale(1.15) !important; }

/* ── Rotation handle: small circle bottom-center ─────────────────────────── */
.sictd-dyt-rot-handle {
    position:absolute; bottom:-8px; left:50%;
    transform:translateX(-50%);
    width:14px; height:14px; border-radius:50%;
    background:var(--sic-navy); color:#fff;
    border:1.5px solid #fff;
    font-size:8px; cursor:grab;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 1px 4px rgba(0,0,0,.28);
    z-index:20; user-select:none;
}
.sictd-dyt-rot-handle:active { cursor:grabbing; }

/* ── Degree label under component ────────────────────────────────────────── */
.sictd-dyt-rot-deg {
    position:absolute; top:calc(100% + 10px); left:50%;
    transform:translateX(-50%);
    font-size:9px; color:var(--sic-navy);
    background:rgba(255,255,255,.92);
    border-radius:3px; padding:1px 5px;
    font-family:monospace; white-space:nowrap;
    pointer-events:none; z-index:25;
}

/* ── Component label (shows below after confirm) ─────────────────────────── */
.sictd-dyt-comp-lbl {
    position:absolute; top:calc(100% + 4px); left:50%;
    transform:translateX(-50%);
    background:rgba(26,43,72,.85); color:#fff;
    font-size:9px; font-family:Arial,sans-serif;
    padding:2px 6px; border-radius:4px;
    white-space:nowrap; pointer-events:none; z-index:30;
}

/* ── Drag ghost ──────────────────────────────────────────────────────────── */
#sictd-dyt-drag-ghost svg { display:block; }

/* ── Drop zone highlight ──────────────────────────────────────────────────── */
.sictd-dyt-map-inner.drag-over .sictd-tank-base {
    outline:3px dashed var(--sic-navy);
    outline-offset:-3px;
}

/* ── Fluid cards with icons (override base for DYT) ──────────────────────── */
.sictd-dyt-fluid-card {
    border:1.5px solid var(--sic-border);
    border-radius:var(--sic-r);
    padding:14px 10px;
    text-align:center;
    cursor:pointer;
    transition:all .2s;
    background:#fff;
}
.sictd-dyt-fluid-card:hover { border-color:var(--sic-navy); box-shadow:0 0 0 3px rgba(6,106,171,.1); }
.sictd-dyt-fluid-card.selected {
    border:2px solid var(--sic-green);
    background:#f0fdf4;
}
.sictd-dyt-fluid-card-icon { font-size:32px; margin-bottom:6px; line-height:1; }
.sictd-dyt-fluid-badge {
    display:inline-block; font-size:9px; font-weight:700;
    letter-spacing:2px; padding:2px 8px;
    border-radius:20px; color:#fff; margin-bottom:5px;
}
.sictd-dyt-fluid-name { font-size:13px; font-weight:600; color:var(--sic-dark); margin-bottom:5px; }
.sictd-dyt-fluid-notes { list-style:none; padding:0; margin:0; text-align:left; }
.sictd-dyt-fluid-notes li { font-size:10px; color:var(--sic-muted); padding:1px 0; }

/* Fluid grid: 3 cols on desktop */
.sictd-dyt-fluid-grid {
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:8px;
    margin-bottom:14px;
}
@media(max-width:640px){ .sictd-dyt-fluid-grid { grid-template-columns:1fr 1fr; } }

/* ── Config popup (inline, appears in wizard col after ✓) ────────────────── */
.sictd-dyt-config-popup {
    position:fixed; inset:0;
    background:rgba(0,0,0,.45);
    display:flex; align-items:center; justify-content:center;
    z-index:9999;
    animation:dytFade .18s ease;
}
@keyframes dytFade { from{opacity:0} to{opacity:1} }
.sictd-dyt-popup-inner {
    background:#fff; border-radius:12px;
    width:90%; max-width:480px;
    max-height:88vh;
    box-shadow:0 16px 50px rgba(0,0,0,.28);
    display:flex; flex-direction:column;
    overflow:hidden; /* let children scroll, not the outer */
}
.sictd-dyt-popup-body {
    flex:1 1 auto;
    overflow-y:auto;
    min-height:0;
    padding:0 18px; /* required for flex scroll to work */
}
.sictd-dyt-popup-hd {
    background:linear-gradient(135deg,var(--sic-navy),var(--sic-dark));
    padding:14px 18px;
    display:flex; align-items:center; justify-content:space-between;
    border-radius:12px 12px 0 0;
}
.sictd-dyt-popup-title { color:#fff; font-size:16px; font-weight:700; }
.sictd-dyt-popup-close {
    background:rgba(255,255,255,.15); border:none; color:#fff;
    width:26px; height:26px; border-radius:50%; cursor:pointer;
    font-size:13px; display:flex; align-items:center; justify-content:center;
}
.sictd-dyt-popup-body { padding:18px; }
.sictd-dyt-popup-ft {
    padding:12px 18px;
    display:flex; justify-content:space-between; gap:8px;
    border-top:1px solid var(--sic-border); background:#f8fafc;
    border-radius:0 0 12px 12px;
    flex:0 0 auto; /* never shrink, never grow */
}
.sictd-dyt-popup-section {
    margin-bottom:14px;
    margin-left:18px;
    margin-right:18px;
}
.sictd-dyt-popup-section-title {
    font-size:10px; font-weight:700; letter-spacing:1px;
    text-transform:uppercase; color:var(--sic-muted); margin-bottom:8px;
}

/* Dist fields */
.sictd-dyt-dist-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.sictd-dyt-dist-field label { display:block; font-size:10px; font-weight:600; color:var(--sic-muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:5px; }
.sictd-dyt-dist-input { display:flex; border:1.5px solid var(--sic-border); border-radius:var(--sic-r); overflow:hidden; margin-bottom:6px; }
.sictd-dyt-dist-input input { flex:1; border:none; padding:7px 9px; font-size:14px; outline:none; font-family:monospace; }
.sictd-dyt-dist-unit { padding:7px 9px; background:var(--sic-light); font-size:11px; color:var(--sic-muted); font-weight:600; border-left:1px solid var(--sic-border); }
.sictd-dyt-dist-field select { width:100%; padding:6px 9px; border:1.5px solid var(--sic-border); border-radius:var(--sic-r); font-size:12px; font-family:inherit; }
.sictd-dyt-vent2-note { padding:8px 12px; background:#e0f2f1; border-radius:6px; font-size:12px; color:#0d9488; border:1px solid #0d9488; margin-top:8px; }

/* Popup select / input */
.sictd-dyt-popup-select { width:100%; padding:8px 10px; border:1.5px solid var(--sic-border); border-radius:var(--sic-r); font-family:inherit; font-size:14px; }
.sictd-dyt-popup-select:focus { outline:none; border-color:var(--sic-navy); }
.sictd-dyt-popup-radio { display:flex; gap:14px; flex-wrap:wrap; }
.sictd-dyt-popup-radio label { display:flex; align-items:center; gap:5px; font-size:13px; cursor:pointer; }
.sictd-dyt-popup-textarea { width:100%; padding:7px 10px; border:1.5px solid var(--sic-border); border-radius:var(--sic-r); font-family:inherit; font-size:13px; resize:vertical; }
.sictd-dyt-popup-textarea:focus { outline:none; border-color:var(--sic-navy); }

/* Rotation row */
.sictd-dyt-rot-row { display:flex; align-items:center; gap:10px; }
.sictd-dyt-rot-row input[type="range"] { flex:1; accent-color:var(--sic-navy); }
.sictd-dyt-rot-val { font-family:monospace; font-size:13px; color:var(--sic-navy); min-width:36px; text-align:right; }

/* ── Summary cards (Step 4) ──────────────────────────────────────────────── */
.sictd-dyt-sum-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
.sictd-dyt-sum-card { background:var(--sic-light); border:1px solid var(--sic-border); border-radius:var(--sic-r); padding:12px; }
.sictd-dyt-sum-card-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--sic-muted); margin-bottom:6px; }
.sictd-dyt-sum-card-val { font-size:14px; font-weight:600; color:var(--sic-dark); }
.sictd-dyt-sum-wide { grid-column:1/-1; }

/* ── Notices ──────────────────────────────────────────────────────────────── */
.sictd-dyt-notice { padding:10px 14px; border-radius:var(--sic-r); font-size:13px; margin:6px 0; }
.sictd-dyt-notice-error   { background:#fff0ee; color:#cc2200; border:1px solid #ffcccc; }
.sictd-dyt-notice-success { background:#edf9f0; color:#22aa55; border:1px solid #a3e6b5; }

/* ── Shape card selected state ───────────────────────────────────────────── */
.sictd-vc-shape-selected,
.sictd-vc-shape-card.sictd-vc-shape-selected {
    border:2px solid var(--sic-navy) !important;
    background:#eef4fb !important;
    box-shadow:0 0 0 3px rgba(6,106,171,.15);
}
.sictd-vc-shape-selected .sictd-vc-shape-name {
    color:var(--sic-navy);
    font-weight:700;
}

/* ── Highlight image pulse animation ─────────────────────────────────────── */
@keyframes sictd-hl-pulse {
    0%   { opacity: 1;    }
    40%  { opacity: 0.05; }
    60%  { opacity: 0.05; }
    100% { opacity: 1;    }
}
.sictd-vc-diag-pulsing {
    animation: sictd-hl-pulse 1.0s ease-in-out infinite;
}

/* Popup section horizontal spacing — ensure consistent with footer padding */
.sictd-dyt-popup-body .sictd-dyt-popup-section {
    margin-left: 18px !important;
    margin-right: 18px !important;
}

/* ── Instructions badge ────────────────────────────────────────────────────── */
.sictd-dyt-instructions-badge {
    background:linear-gradient(135deg,#f0f9ff,#e0f2fe);
    border:1px solid #bae6fd;
    border-left:4px solid #066aab;
    border-radius:10px;
    padding:12px 16px;
    margin-bottom:12px;
    font-size:12px;
}
.sictd-dyt-instr-title {
    font-weight:700;
    color:#0369a1;
    font-size:13px;
    margin-bottom:8px;
}
.sictd-dyt-instr-steps {
    display:flex;
    flex-direction:column;
    gap:4px;
    color:#374151;
    margin-bottom:10px;
    line-height:1.5;
}
.sictd-dyt-instr-legend {
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    border-top:1px solid #bae6fd;
    padding-top:8px;
}
.sictd-dyt-leg-item {
    display:flex;
    align-items:center;
    gap:5px;
    color:#4b5563;
    font-size:11px;
    font-weight:600;
}
.sictd-dyt-leg-dot {
    width:12px; height:12px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,.8);
    box-shadow:0 1px 3px rgba(0,0,0,.2);
    flex-shrink:0;
}

/* ── Language switcher — two visible badges ─────────────────── */
.sictd-lang-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
}
.sictd-lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sictd-lang-btn.active {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}
.sictd-lang-btn:hover:not(.active) {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}

/* ── Step instruction card row (full width between progress and main) ─────── */
#sictd-dyt-step-card-row {
    margin: 0 0 12px 0;
}
.sictd-step-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #0d2340;
    border-radius: 9px;
    padding: 14px 18px;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.65;
    color: #1e3a5f;
}
.sictd-step-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}
.sictd-step-card-body {
    flex: 1;
}
.sictd-step-card-body strong {
    color: #0d2340;
}
.sictd-step-card-body ul,
.sictd-step-card-body ol {
    font-size: 13px;
    line-height: 1.7;
    margin-top: 4px;
}
.sictd-step-card-body li {
    margin-bottom: 3px;
}
