/* =============================================================
   ANSI-Editor — Wizard UI
   ============================================================= */

/* --- Wizard Steps Indicator --- */
.ansi-wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    overflow-x: auto;
    border-bottom: 0px solid #e0e0e0;
}
.ansi-step {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 0;
}
.ansi-step:hover { color: #333; }
.ansi-step.active {
    color: #1a1a1a;
    border-bottom-color: var(--color-primary, #2563eb);
    font-weight: 600;
}
.ansi-step.completed {
    color: var(--color-accent, #16a34a);
    border-bottom-color: var(--color-accent, #16a34a);
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 4px;
}
.ansi-step.active .step-num {
    background: var(--color-primary, #2563eb);
    color: #fff;
}
.ansi-step.completed .step-num {
    background: var(--color-accent, #16a34a);
    color: #fff;
}

/* --- Wizard Panels --- */
.ansi-wizard-panel {
    display: none;
    animation: fadeIn 0.2s ease;
}
.ansi-wizard-panel.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Wizard Nav --- */
.ansi-wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* --- Step 1: Templates --- */
.ansi-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.ansi-template-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.ansi-template-card:hover {
    border-color: var(--color-accent, #2563eb);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ansi-template-card.selected {
    border-color: var(--color-accent, #2563eb);
    background: #f082263d;
}
.ansi-template-card--blank .template-icon {
    font-size: 2.5rem;
    color: #888;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.template-signal {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.template-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.template-texts {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    text-align: left;
}

/* --- Step 2: Signal Words --- */
.ansi-signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.ansi-signal-btn {
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.ansi-signal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.ansi-signal-btn.selected {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.2);
}
.signal-word {
    display: block;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.signal-desc {
    display: block;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* --- Step 3: Layouts --- */
.ansi-layout-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.ansi-layout-btn {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.ansi-layout-btn:hover {
    border-color: var(--color-accent, #2563eb);
}
.ansi-layout-btn.selected {
    border-color: var(--color-accent, #2563eb);
    background: #f082263d;
}
.layout-preview {
    width: 100%;
    height: 90px;
    border: 2px solid #333;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-rows: 28px 1fr;
    font-size: 0.6rem;
    text-align: center;
    line-height: 1;
    overflow: hidden;
}
.lp-signal {
    background: #F57F17;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #333;
}
.lp-text {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.65rem;
}
.lp-picto {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.6rem;
}
.lp-text + .lp-picto,
.lp-picto + .lp-text {
    border-left: 2px solid #333;
}
.lp-picto + .lp-text + .lp-picto {
    border-left: 2px solid #333;
}
.layout-label { font-size: 0.85rem; font-weight: 600; }

/* --- Step 4: Text --- */
.ansi-text-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.ansi-text-columns.bilingual {
    grid-template-columns: 1fr 1fr;
}
.ansi-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}
.ansi-char-count.over-limit { color: #dc2626; font-weight: 600; }
.ansi-text-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.instruction-row .instruction-input {
    font-size: 0.9rem;
    padding: 6px 10px;
}
.instruction-row .btn-remove-instruction:hover {
    color: #900;
}
.ansi-disclaimer {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #92400e;
}
.ansi-col2-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.ansi-col2-header select { flex: 1; }

/* --- Step 5: Pictograms --- */
.ansi-picto-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ansi-picto-filters {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.ansi-filter-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.ansi-filter-btn:hover { border-color: var(--primary, #2563eb); }
.ansi-filter-btn.active {
    background: var(--primary, #2563eb);
    color: #fff;
    border-color: var(--primary, #2563eb);
}

.ansi-picto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.ansi-picto-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}
.ansi-picto-item:hover { border-color: var(--primary, #2563eb); }
.ansi-picto-item.selected {
    border-color: var(--primary, #2563eb);
    background: #f0f4ff;
}
.ansi-picto-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}
.ansi-picto-item .picto-tags {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ansi-picto-selected {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}
#picto-selected-list {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
#picto-selected-list img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
}

/* --- Price Display (matches .product-price-block) --- */
.ansi-price-display {
    margin-bottom: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg-alt, #f8f9fa);
    border-radius: 6px;
    border-left: 4px solid var(--color-accent, #2563eb);
}
.ansi-price-display .price-total {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-accent, #2563eb);
}
.ansi-price-display .price-unit {
    font-size: 0.8125rem;
    color: var(--color-text-light, #666);
    margin-top: 0.25rem;
}

/* --- Step 6: Preview --- */
.ansi-preview-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}
.ansi-preview-frame {
    padding: 3rem;
    background: linear-gradient(to top, #6b6b6b, #4a4a4a);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    transition: min-height 0.3s ease;
}
.ansi-preview-sticker {
    background: #fff;
    border-radius: 6px;
    padding: 6px;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.35),
        0 1px 4px rgba(0,0,0,0.2);
    display: inline-block;
    transform-origin: center center;
}
.ansi-preview-sticker > div {
    border-radius: 3px;
    overflow: hidden;
}
.ansi-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
/* --- Modals --- */
.ansi-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ansi-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ansi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}
.ansi-modal-header h3 { margin: 0; }
.ansi-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}
.ansi-modal-body { padding: 1.25rem; }
.ansi-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e0e0e0;
}

.ansi-translate-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.translate-col {
    padding: 0.75rem;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 0.85rem;
}

/* --- Spinner --- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Meine Aufkleber --- */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.25rem;
}
.sticker-card {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.sticker-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.sticker-card__preview {
    width: 160px;
    min-height: 120px;
    background: linear-gradient(to top, #6b6b6b, #4a4a4a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    flex-shrink: 0;
}
.sticker-card__preview img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 3px;
}
.sticker-card__no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.sticker-card__info {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sticker-card__signal {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    align-self: flex-start;
}
.sticker-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    color: #666;
}
.sticker-card__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .ansi-layout-grid { grid-template-columns: repeat(2, 1fr); }
    .ansi-signal-grid { grid-template-columns: 1fr; }
    .ansi-text-columns.bilingual { grid-template-columns: 1fr; }
    .ansi-preview-container { grid-template-columns: 1fr; }
    .ansi-translate-compare { grid-template-columns: 1fr; }
    .sticker-grid { grid-template-columns: 1fr; }
    .sticker-card { flex-direction: column; }
    .sticker-card__preview { width: 100%; min-height: 100px; }
}
