/* ==========================================================================
   == طرح‌بندی اصلی و کانتینرها ==
   ========================================================================== */
.form-container {
    height: 100%;
}

.content-header {
    background: #f8f9fa;
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-body {
    padding: 2rem;
}

.stage-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px dashed #dee2e6;
    position: relative;
}

.stage-container.active {
    border-color: #0d6efd;
    background: #e7f1ff;
}

/* ==========================================================================
   == سایدبار و تایم‌لاین (Sidebar & Timeline) ==
   ========================================================================== */
.sidebar {
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.timeline-sidebar {
    width: 320px;
    background: linear-gradient(180deg, #2d3561 0%, #1a1f3a 100%);
    color: white;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.timeline-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-iso {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* تایم‌لاین افقی در سایدبار اصلی */
.timeline {
    position: relative;
    padding: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-right: 45px;
    /* برای تایم‌لاین افقی */
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0d6efd;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #dee2e6;
}

/* تایم‌لاین عمودی در سایدبار تیره */
.vertical-timeline {
    position: relative;
    padding-left: 40px;
}

.vertical-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.vertical-timeline .timeline-item {
    padding-right: 0;
    /* ریست کردن استایل تایم‌لاین دیگر */
    padding-bottom: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vertical-timeline .timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -25px;
    top: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #4a5568;
    border: 3px solid #2d3561;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.vertical-timeline .timeline-item.active .timeline-dot {
    background: #f39c12;
    border-color: #f39c12;
    width: 40px;
    height: 40px;
    left: -30px;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
    animation: pulse 2s infinite;
}

.vertical-timeline .timeline-item.completed .timeline-dot {
    background: #27ae60;
    border-color: #27ae60;
}

.vertical-timeline .timeline-item.rejected .timeline-dot {
    background: #e74c3c;
    border-color: #e74c3c;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.vertical-timeline .timeline-item:hover .timeline-content {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
}

.vertical-timeline .timeline-item.active .timeline-content {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid rgba(243, 156, 18, 0.5);
}

.stage-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stage-info {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ==========================================================================
   == کارت‌ها و پنل‌ها (Cards & Panels) ==
   ========================================================================== */
.form-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.form-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    background-color: #f8f9fa;
    /* ترکیب هاورها */
}

.form-card:last-child {
    border-bottom: none !important;
}

.card-hover:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.form-info-card {
    background: transparent;
    /* یا background: none; */
    color: #333;
    /* رنگ متن را تیره کنید چون دیگر پس‌زمینه تیره ندارید */
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
    /* اختیاری: برای مشخص شدن مرز */
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.status-card.pending {
    border-right: 4px solid #f39c12;
}

.status-card.approved {
    border-right: 4px solid #27ae60;
}

.status-card.rejected {
    border-right: 4px solid #e74c3c;
}

.approver-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.approver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.preview-container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stage-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ==========================================================================
   == عناصر فرم (Form Elements) ==
   ========================================================================== */
.form-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.field-group:hover {
    border-color: #e0e0e0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.field-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.field-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1);
}

.field-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3561;
}

.required-star {
    color: #e74c3c;
    font-weight: bold;
}

/* استایل مربوط به آپلود فایل */
.upload-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #f39c12;
    background: #fffef5;
}

.upload-zone.dragover {
    border-color: #f39c12;
    background: #fff8e1;
    transform: scale(1.02);
}

/* استایل ورودی چند مقداری (Multi-value Input) */
.multi-value-wrapper {
    position: relative;
}

.multi-value-container {
    min-height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    cursor: text;
}

.multi-value-container:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.value-tag {
    background-color: #0d6efd;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.value-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.value-tag .remove-tag:hover {
    opacity: 1;
}

.multi-value-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 100px;
    padding: 0.25rem;
    background: transparent;
}

.multi-value-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* ==========================================================================
   == دکمه‌ها و اکشن‌ها (Buttons & Actions) ==
   ========================================================================== */
.btn-floating {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.action-buttons {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.btn-primary-custom {
    background: #f39c12;
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.add-field-btn {
    border: 2px dashed #6c757d;
    background: transparent;
    color: #6c757d;
    padding: 0.75rem;
    border-radius: 6px;
    width: 100%;
    transition: all 0.3s ease;
}

.add-field-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #e7f1ff;
}

.field-actions {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: none;
}

.field-item:hover .field-actions {
    display: flex;
    gap: 0.25rem;
}

/* ==========================================================================
   == نشان‌ها و وضعیت‌ها (Badges & Statuses) ==
   ========================================================================== */
.status-badge {
    font-size: 0.85em;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-complete {
    background-color: #d1edff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-canceled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c2c7;
}

.field-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.deadline-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.deadline-badge.urgent {
    background: rgba(231, 76, 60, 0.3);
    color: #ff6b6b;
    animation: blink 1.5s infinite;
}

/* ==========================================================================
   == عناصر متفرقه (Miscellaneous) ==
   ========================================================================== */
/* استایل برای بخش‌های آکاردئونی */
.category-header {
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-header:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.category-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

.last-child-no-border .form-card:last-child {
    border-bottom: none !important;
}

/* استایل برای آیتم‌های شرطی */
.condition-item {
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.condition-item:hover {
    background-color: #e9ecef;
}

.remove-condition {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.remove-condition:hover {
    opacity: 1;
    transform: scale(1.1);
}

#emptyState {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

/* حلقه پیشرفت (Progress Ring) */
.progress-ring {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0 auto 1rem;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.progress-ring-circle-progress {
    fill: none;
    stroke: #f39c12;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3561;
}

/* ==========================================================================
   == انیمیشن‌ها (Animations) ==
   ========================================================================== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(243, 156, 18, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}