/**
 * استایل سیستم مدیریت پیشرفت کار رساله
 * Thesis Workflow Management System Styles
 */

/* کانتینر اصلی */
#thesis-workflow-container {
    padding: 20px;
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* هدر */
.workflow-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.workflow-header h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary, #333);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.workflow-header h3 i {
    color: var(--primary-color, #007bff);
}

/* نوار پیشرفت */
.workflow-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-weight: 600;
    color: var(--text-secondary, #666);
    min-width: 100px;
    text-align: left;
}

/* مراحل کاری */
.workflow-steps {
    margin: 30px 0;
    position: relative;
}

.workflow-step {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    transition: all 0.3s ease;
}

.workflow-step:hover {
    transform: translateX(-5px);
}

/* اندیکاتور مرحله */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary, #f5f5f5);
    border: 3px solid var(--border-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-secondary, #666);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.workflow-step.active .step-number {
    background: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(0, 123, 255, 0.1); }
}

.workflow-step.completed .step-number {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.workflow-step.rejected .step-number {
    background: #f44336;
    border-color: #f44336;
    color: white;
}

.step-connector {
    width: 3px;
    flex: 1;
    background: var(--border-color, #e0e0e0);
    margin: 5px 0;
    transition: background 0.3s ease;
}

.workflow-step.completed .step-connector {
    background: #4CAF50;
}

.workflow-step:last-child .step-connector {
    display: none;
}

/* محتوای مرحله */
.step-content {
    flex: 1;
    background: var(--bg-secondary, #f9f9f9);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.workflow-step.active .step-content {
    background: var(--bg-primary, #ffffff);
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.workflow-step.completed .step-content {
    background: #f1f8f4;
    border-color: #4CAF50;
}

.workflow-step.rejected .step-content {
    background: #ffebee;
    border-color: #f44336;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.step-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary, #333);
    font-weight: 600;
}

.step-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.step-actor {
    padding: 4px 12px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

.step-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.step-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.step-status.status-in_progress {
    background: #cfe2ff;
    color: #084298;
}

.step-status.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.step-status.status-rejected {
    background: #f8d7da;
    color: #842029;
}

.step-status.status-terminated {
    background: #e2e3e5;
    color: #41464b;
}

.step-description {
    margin: 10px 0;
    color: var(--text-secondary, #666);
    line-height: 1.6;
}

/* نیازمندی‌های مرحله */
.step-requirements {
    margin: 15px 0;
    padding: 15px;
    background: var(--bg-primary, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.step-requirements h5 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--text-primary, #333);
}

.step-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement-item {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary, #666);
}

.requirement-item i {
    font-size: 1.1rem;
}

.requirement-item.status-completed {
    color: #4CAF50;
}

.requirement-item.status-completed i {
    color: #4CAF50;
}

/* یادداشت‌ها */
.step-notes {
    margin: 15px 0;
    padding: 12px;
    background: #fff9e6;
    border-right: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

/* اکشن‌های مرحله */
.step-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.step-actions .btn {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* تایم‌استمپ */
.step-timestamp {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #e0e0e0);
    font-size: 0.85rem;
    color: var(--text-secondary, #999);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* نیازمندی‌های اضافی */
.workflow-requirements {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-secondary, #f9f9f9);
    border-radius: 12px;
}

.workflow-requirements h4 {
    margin: 0 0 20px 0;
    color: var(--text-primary, #333);
    font-size: 1.2rem;
}

.requirement-card {
    background: var(--bg-primary, #ffffff);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color, #e0e0e0);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.requirement-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.requirement-card.status-completed {
    border-color: #4CAF50;
    background: #f1f8f4;
}

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

.requirement-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #333);
}

.requirement-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.requirement-card.status-completed .requirement-status {
    background: #d1e7dd;
    color: #0f5132;
}

.requirement-card.status-pending .requirement-status {
    background: #fff3cd;
    color: #856404;
}

.requirement-card p {
    margin: 10px 0;
    color: var(--text-secondary, #666);
}

.requirement-actions {
    margin-top: 10px;
}

/* اکشن‌های کلی */
.workflow-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}

.workflow-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* انیمیشن‌های اعلان */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* حالت تاریک */
[data-theme="dark"] #thesis-workflow-container {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .step-content {
    background: var(--bg-secondary, #2d2d2d);
}

[data-theme="dark"] .workflow-step.active .step-content {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .step-requirements,
[data-theme="dark"] .requirement-card {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .workflow-requirements {
    background: var(--bg-secondary, #2d2d2d);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .workflow-step {
        gap: 15px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-content {
        padding: 15px;
    }
    
    .step-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .step-meta {
        width: 100%;
    }
    
    .workflow-actions {
        flex-direction: column;
    }
    
    .workflow-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #thesis-workflow-container {
        padding: 15px;
    }
    
    .workflow-header h3 {
        font-size: 1.2rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .step-actions .btn {
        width: 100%;
    }
}


/* نمایش افقی مراحل */
.workflow-steps-horizontal {
    margin: 30px 0;
    padding: 30px 20px;
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.steps-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-width: max-content;
    padding: 20px 0;
    position: relative;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    padding: 0 10px;
}

.timeline-step:hover {
    transform: translateY(-5px);
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    border: 3px solid;
    transition: all 0.3s ease;
    z-index: 2;
    background: var(--bg-primary, #ffffff);
}

.timeline-step.pending .step-circle {
    border-color: #ccc;
    color: #999;
}

.timeline-step.active .step-circle {
    border-color: #007bff;
    color: #007bff;
    background: #e7f3ff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
    animation: pulse 2s infinite;
}

.timeline-step.completed .step-circle {
    border-color: #28a745;
    color: white;
    background: #28a745;
}

.timeline-step.rejected .step-circle {
    border-color: #dc3545;
    color: white;
    background: #dc3545;
}

.step-label {
    margin-top: 10px;
    font-size: 0.85rem;
    text-align: center;
    max-width: 100px;
    word-wrap: break-word;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

.timeline-step.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.timeline-step.completed .step-label {
    color: #28a745;
}

.step-line {
    position: absolute;
    top: 25px;
    right: -50%;
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}

.timeline-step.completed .step-line {
    background: #28a745;
}

/* جزئیات مرحله */
.step-details-container {
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.step-details-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.step-number-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.step-number-badge.pending {
    background: #6c757d;
}

.step-number-badge.active,
.step-number-badge.in_progress {
    background: #007bff;
}

.step-number-badge.completed {
    background: #28a745;
}

.step-number-badge.rejected {
    background: #dc3545;
}

.step-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.step-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-section {
    background: var(--bg-secondary, #f9f9f9);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary, #333);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: #007bff;
}

.detail-box {
    background: var(--bg-primary, #ffffff);
    padding: 15px;
    border-radius: 6px;
}

.financial-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-secondary, #f9f9f9);
    border-radius: 6px;
}

.financial-item .label {
    font-weight: 600;
    color: var(--text-secondary, #666);
}

.financial-item .value {
    font-weight: bold;
    color: var(--text-primary, #333);
}

.step-details-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}

/* ریسپانسیو برای نمایش افقی */
@media (max-width: 1200px) {
    .steps-timeline {
        justify-content: flex-start;
        gap: 20px;
    }
    
    .timeline-step {
        min-width: 70px;
    }
    
    .step-circle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .workflow-steps-horizontal {
        padding: 20px 10px;
    }
    
    .timeline-step {
        min-width: 60px;
        padding: 0 5px;
    }
    
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .step-label {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    .step-details-content {
        grid-template-columns: 1fr;
    }
    
    .step-details-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .step-details-actions {
        flex-direction: column;
    }
    
    .step-details-actions .btn {
        width: 100%;
    }
}

/* حالت تاریک برای بخش‌های جدید */
[data-theme="dark"] .workflow-steps-horizontal {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .step-circle {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .timeline-step.active .step-circle {
    background: #1a3a5c;
}

[data-theme="dark"] .step-details-container {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .detail-section {
    background: var(--bg-secondary, #2d2d2d);
}

[data-theme="dark"] .detail-box {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .financial-item {
    background: var(--bg-secondary, #2d2d2d);
}


/* استایل دکمه‌ها */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-dark {
    background: #343a40;
    color: white;
}

.btn-dark:hover {
    background: #23272b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

/* حالت تاریک برای دکمه‌ها */
[data-theme="dark"] .btn-warning {
    color: #000;
}

[data-theme="dark"] .btn-warning:hover {
    color: #000;
}


/* نمایش 2 ستونی مراحل */
.workflow-steps-two-columns {
    margin: 30px 0;
}

.workflow-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.workflow-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* کارت ساده مرحله */
.step-card-simple {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
}

.step-card-simple:hover {
    background: var(--bg-secondary, #f5f5f5);
    transform: translateX(-3px);
}

.step-number-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 3px solid;
}

.step-number-circle.pending {
    background: #f8f9fa;
    border-color: #ccc;
    color: #999;
}

.step-number-circle.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    animation: pulse 2s infinite;
}

.step-number-circle.completed {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.step-number-circle.rejected {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.step-title-simple {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #333);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.step-card-simple.active .step-title-simple {
    color: #007bff;
}

.step-card-simple.completed .step-title-simple {
    color: #28a745;
}

.step-card-simple.rejected .step-title-simple {
    color: #dc3545;
}

.step-connector-simple {
    position: absolute;
    bottom: -12px;
    right: 22px;
    width: 3px;
    height: 12px;
    background: var(--border-color, #e0e0e0);
}

.step-card-simple.completed .step-connector-simple {
    background: #28a745;
}

/* تنظیم فاصله دکمه‌های عملیات */
.workflow-actions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color, #e0e0e0);
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .workflow-columns {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .workflow-columns {
        gap: 20px;
    }
    
    .step-card-simple {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .step-number-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-title-simple {
        font-size: 0.9rem;
    }
}

/* حالت تاریک */
[data-theme="dark"] .step-card-simple:hover {
    background: var(--bg-secondary, #2d2d2d);
}

[data-theme="dark"] .step-number-circle.pending {
    background: #2d2d2d;
}


/* دکمه افزودن مرحله */
.step-wrapper {
    position: relative;
}

.step-add-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12px;
}

.btn-add-step {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: 2px solid var(--bg-primary, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.step-wrapper:hover .btn-add-step {
    opacity: 1;
}

.btn-add-step:hover {
    background: #0056b3;
    transform: scale(1.2);
}

.btn-add-step i {
    font-size: 0.7rem;
}

/* مودال افزودن مرحله */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px;
}

.modal-header .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* فرم */
.form-label {
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid var(--border-color, #e0e0e0);
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* حالت تاریک */
[data-theme="dark"] .btn-add-step {
    border-color: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-primary, #1e1e1e);
    color: var(--text-primary, #fff);
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, #0056b3, #003d82);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-secondary, #2d2d2d);
    color: var(--text-primary, #fff);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--bg-secondary, #2d2d2d);
    border-color: #007bff;
}


/* مودال سفارشی */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.custom-modal-content {
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.custom-modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.custom-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.custom-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.custom-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* حالت تاریک */
[data-theme="dark"] .custom-modal-content {
    background: var(--bg-primary, #1e1e1e);
}

[data-theme="dark"] .custom-modal-header {
    background: linear-gradient(135deg, #0056b3, #003d82);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .custom-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .custom-modal-header {
        padding: 15px;
    }
    
    .custom-modal-title {
        font-size: 1rem;
    }
    
    .custom-modal-body {
        padding: 20px;
    }
    
    .custom-modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .custom-modal-footer .btn {
        width: 100%;
    }
}
