/* ============================================
   Sequence Builder / Automation Steps CSS
   Extracted from automation_steps.html inline styles
   White Glass Theme Flow Builder
   ============================================ */

.sequence-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-action.comment {
    color: #0ea5e9;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.btn-action.comment:hover {
    background: #e0f2fe;
}

.btn-action.dm {
    color: #8b5cf6;
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.btn-action.dm:hover {
    background: #ede9fe;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline-container {
    position: relative;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-left: 2px solid #e2e8f0;
    margin-left: 16px;
}

.step-card {
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.step-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.step-dot {
    position: absolute;
    left: -35px;
    top: 24px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.step-dot.comment {
    background: #0ea5e9;
}

.step-dot.dm {
    background: #8b5cf6;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.step-badge.comment {
    background: #e0f2fe;
    color: #0369a1;
}

.step-badge.dm {
    background: #ede9fe;
    color: #7c3aed;
}

.step-number {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

.step-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   DELAY CONTROL
   ============================================ */

.delay-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 10px;
    gap: 8px;
    color: #64748b;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

.delay-val {
    font-family: 'JetBrains Mono', monospace;
    color: #1e293b;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.delay-slider {
    -webkit-appearance: none;
    width: 70px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

.delay-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

.delay-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.delay-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

.btn-delete {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    opacity: 0.6;
}

.step-card:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ============================================
   CONTENT INPUTS
   ============================================ */

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.variable-buttons {
    display: flex;
    gap: 6px;
}

.var-btn {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.var-btn:hover {
    border-color: #8b5cf6;
    color: #7c3aed;
    background: #f5f3ff;
}

.var-btn.link {
    color: #10b981;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.var-btn.link:hover {
    border-color: #10b981;
    background: #d1fae5;
}

.text-input {
    width: 100%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #1e293b;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.text-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.text-input::placeholder {
    color: #94a3b8;
}

.dm-options {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* ============================================
   RICH CONTENT ATTACHMENTS
   ============================================ */

.attach-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.attach-btn:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.attach-btn.active {
    border-style: solid;
    border-color: #10b981;
    background: #ecfdf5;
}

.attach-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.attach-icon.violet {
    background: #ede9fe;
    color: #8b5cf6;
}

.attach-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.attach-icon.pink {
    background: #fce7f3;
    color: #ec4899;
}

.attach-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
}

.attach-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.attach-badge.check {
    background: #10b981;
}

/* ============================================
   ATTACHED PREVIEW
   ============================================ */

.attached-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #475569;
}

.preview-item.button {
    background: #ede9fe;
    color: #7c3aed;
}

.preview-item.product {
    background: #d1fae5;
    color: #059669;
}

.preview-thumb {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

.preview-text {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-price {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.preview-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    margin-left: 4px;
}

.preview-remove:hover {
    color: #ef4444;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-steps {
    text-align: center;
    padding: 3rem 1rem;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    background: #fafafa;
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: #f1f5f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .builder-header {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        justify-content: center;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .step-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 8px;
    }

    .timeline-container {
        margin-left: 8px;
        padding-left: 16px;
    }

    .step-dot {
        left: -26px;
        width: 14px;
        height: 14px;
    }
}