/* Wizard Progress */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.4;
    transition: opacity var(--transition-slow);
}

.step.active, .step.completed {
    opacity: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid var(--border-default);
    background: var(--bg-secondary);
    transition: border-color var(--transition-slow), background-color var(--transition-slow), color var(--transition-slow);
}

.step.active .step-circle {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.step.completed .step-circle {
    border-color: var(--accent-success);
    background: var(--accent-success);
    color: var(--color-on-accent);
}

.step-info {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.step-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.step-line {
    width: 24px;
    height: 2px;
    background: var(--border-default);
    flex-shrink: 0;
}

/* Wizard Step */
.wizard-step {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.wizard-step[hidden] {
    display: none;
}

.step-header {
    margin-bottom: var(--space-lg);
}

.step-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.step-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Search */
.search-container {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.search-input {
    flex: 1;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-btn {
    white-space: nowrap;
    padding: 0 var(--space-lg);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

/* Preset Grid */
.preset-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.preset-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.preset-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.preset-card:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

.preset-card.selected {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.preset-card input {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.preset-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.preset-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    flex-shrink: 0;
}

.preset-card.selected .preset-checkbox {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
}

.preset-checkbox::after {
    content: '✓';
    color: var(--color-on-accent);
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.preset-card.selected .preset-checkbox::after {
    opacity: 1;
}

.preset-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.preset-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.preset-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading */
.preset-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 1.6s;
    }
}

/* Domain Panel */
.domain-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.domain-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.domain-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.domain-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.domain-list {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.domain-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.domain-item:hover {
    background: var(--bg-tertiary);
}

.domain-item input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.domain-item label {
    flex: 1;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    min-width: 0;
    word-break: break-word;
}

.domain-source {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.domain-comment {
    font-size: 11px;
    color: #32cd32;
    margin-left: var(--space-xs);
    font-style: italic;
}

.domain-panel-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.select-all-label input {
    accent-color: var(--accent-primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Review Stats */
.review-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-xs);
}

/* Review List */
.review-list-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: var(--space-md);
}

.review-list {
    padding: var(--space-xs);
}

.review-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
    gap: var(--space-sm);
}

.review-item:hover {
    background: var(--bg-tertiary);
}

.review-item-custom {
    background: rgba(var(--accent-purple-rgb), 0.05);
}

.review-item-custom:hover {
    background: rgba(var(--accent-purple-rgb), 0.1);
}

.review-domain {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.review-source {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.review-item-custom .review-source {
    background: rgba(var(--accent-purple-rgb), 0.2);
    color: var(--accent-purple);
}

.review-item-duplicate {
    background: rgba(var(--accent-warning-rgb), 0.1);
    border-left: 3px solid var(--accent-warning);
}

.review-item-duplicate:hover {
    background: rgba(var(--accent-warning-rgb), 0.15);
}

.review-item-duplicate .review-domain {
    color: var(--accent-warning);
}

.duplicate-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--color-on-accent);
    background: var(--accent-warning);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.stat-card-duplicates {
    border: 1px solid var(--border-subtle);
}

.stat-card-duplicates .stat-value {
    color: var(--text-muted);
}

.stat-card-duplicates.has-duplicates {
    border-color: var(--accent-warning);
    background: rgba(var(--accent-warning-rgb), 0.05);
}

.stat-card-duplicates.has-duplicates .stat-value {
    color: var(--accent-warning);
}

.review-comment {
    font-size: 11px;
    color: #32cd32;
    font-style: italic;
    margin-left: var(--space-sm);
}

.remove-btn {
    background: transparent;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    padding: var(--space-xs) var(--space-sm);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.remove-btn:hover {
    background: var(--accent-danger);
    color: var(--color-on-accent);
}

.remove-btn:focus-visible {
    box-shadow: var(--focus-ring);
}

/* Custom Domain Input */
.custom-domain-input {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.custom-domain-input input {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.custom-domain-input input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

.custom-domain-input button {
    background: var(--accent-primary);
    border: none;
    color: var(--color-on-accent);
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 13px;
    transition: background-color var(--transition-fast);
}

.custom-domain-input button:hover {
    background: var(--accent-secondary);
}

.custom-domain-input button:focus-visible {
    box-shadow: var(--focus-ring);
}

/* Custom Step */
.custom-step-container {
    display: grid;
    gap: var(--space-lg);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.file-upload-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.file-upload-area {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    text-align: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    touch-action: manipulation;
}

.file-upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.file-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(var(--accent-success-rgb), 0.1);
    border: 1px solid var(--accent-success);
    border-radius: var(--radius-md);
}

.file-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.file-domains-count {
    font-size: 12px;
    color: var(--accent-success);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.manual-input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.manual-input-section textarea {
    width: 100%;
    min-height: 120px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 13px;
    resize: vertical;
    margin-bottom: var(--space-md);
}

.manual-input-section textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

.manual-input-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.domains-added-info {
    font-size: 12px;
    color: var(--accent-success);
    font-weight: 600;
}

.custom-domains-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.custom-domains-preview .preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.custom-domains-preview .preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-domains-preview .preview-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple);
    background: rgba(var(--accent-purple-rgb), 0.1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.custom-domains-preview .preview-list {
    max-height: 200px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.preview-item:hover {
    background: var(--bg-tertiary);
}

.preview-domain {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
}

.remove-btn-small {
    background: transparent;
    border: none;
    color: var(--accent-danger);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 var(--space-xs);
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    touch-action: manipulation;
}

.remove-btn-small:hover {
    opacity: 1;
}

.remove-btn-small:focus-visible {
    opacity: 1;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* Export Selector */
.export-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.export-selector {
    flex: 1;
    min-width: 200px;
}

.export-selector label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.export-selector select {
    width: 100%;
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    padding-right: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    font-size: 14px;
}

.export-selector select:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

.export-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    cursor: pointer;
    user-select: none;
}

.export-checkbox input {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.export-checkbox span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Preview Panel */
.preview-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-success);
    font-variant-numeric: tabular-nums;
}

.preview-output {
    width: 100%;
    height: 320px;
    background: var(--bg-primary);
    border: none;
    color: var(--accent-success);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: none;
}

.preview-output:focus {
    box-shadow: inset var(--focus-ring);
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    touch-action: manipulation;
}

.btn-primary {
    background: var(--accent-primary);
    border: none;
    color: var(--color-on-accent);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary:disabled:hover {
    background: var(--accent-primary);
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: var(--color-on-accent);
}

.btn-warning {
    background: transparent;
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
}

.btn-warning:hover {
    background: var(--accent-warning);
    color: var(--color-on-accent);
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
}

/* Mobile */
@media (max-width: 768px) {
    .wizard-progress {
        padding: var(--space-sm);
        margin-bottom: var(--space-md);
    }

    .step-line {
        width: 12px;
    }

    .step-info {
        display: none;
    }

    .preset-grid {
        grid-template-columns: 1fr;
    }

    .wizard-step {
        padding: var(--space-md);
    }

    .action-bar {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        text-align: center;
        min-width: 100px;
    }

    .custom-domain-input {
        flex-direction: column;
    }

    .custom-domain-input button {
        width: 100%;
    }

    .file-upload-area {
        flex-direction: column;
        padding: var(--space-md);
    }

    .manual-input-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
