/**
 * استایل‌های اصلی سیستم پیگیری مشتریان
 */

/* تنظیمات کلی */
.customer-tracking-container {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-title, .table-title {
    text-align: center;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* استایل پیام‌ها */
.message-box {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.message-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-box.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message-box.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* استایل‌های فرم */
.form-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.edit-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
}

.edit-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-form input {
    flex: 1;
    min-width: 100px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group, .radio-group {
    margin-top: 8px;
}

.checkbox-group label, .radio-group label {
    font-weight: normal;
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.subcategory-group {
    display: none;
    margin-right: 15px;
    padding: 10px;
    border-right: 3px solid #e9ecef;
}

.subcategory-group.active {
    display: block;
}

.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

button, .btn-primary, .btn-secondary, .btn-info {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-info {
    background-color: #2ecc71;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-info:hover {
    background-color: #27ae60;
}

input[type="radio"], input[type="checkbox"] {
    width: auto;
    margin-left: 5px;
}

label.radio-label, label.checkbox-label {
    display: inline-block;
    margin-left: 15px;
}

.form-mode-indicator {
    font-size: 14px;
    background-color: #f1c40f;
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 10px;
    display: inline-block;
    margin-bottom: 15px;
}

/* استایل‌های جدول */
.table-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-section {
    flex-grow: 1;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-item {
    margin-left: 15px;
    min-width: 150px;
}

.filter-item label {
    margin-bottom: 5px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.customers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.customers-table th {
    background-color: #f5f7fa;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.customers-table th, .customers-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: right;
}

.customers-table tr:hover {
    background-color: #f8f9fa;
}

.customers-table th.sortable {
    cursor: pointer;
    position: relative;
}

.customers-table th.sortable:after {
    content: '\f0dc';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 5px;
    color: #ccc;
}

.customers-table th.sort-asc:after {
    content: '\f0de';
    color: #3498db;
}

.customers-table th.sort-desc:after {
    content: '\f0dd';
    color: #3498db;
}

.customers-table td.description-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customers-table td.description-cell:hover {
    white-space: normal;
    overflow: visible;
}

.customers-table td.actions {
    white-space: nowrap;
    width: 80px;
    text-align: center;
}

.customers-table .edit-btn {
    color: #3498db;
    margin: 0 5px;
    font-size: 16px;
}

.customers-table .edit-btn:hover {
    color: #2980b9;
}

.no-results, .loading, .error {
    text-align: center;
    padding: 20px !important;
    font-style: italic;
    color: #777;
}

.loading i {
    margin-left: 5px;
    color: #3498db;
}

.error {
    color: #e74c3c;
}

/* پیجینیشن */
.pagination-container {
    margin-top: 20px;
}

.customer-tracking-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    color: #666;
}

.pagination-links {
    display: flex;
    gap: 5px;
}

.page-link {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #3498db;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link:hover {
    background-color: #f5f5f5;
}

.page-link.current {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link.disabled {
    color: #ccc;
    pointer-events: none;
}

.page-link.dots {
    border: none;
    padding: 6px 8px;
}

/* ریسپانسیو */
@media screen and (max-width: 768px) {
    .edit-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .edit-form input, .edit-form button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button, .button-group a {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .filter-item {
        width: 100%;
        margin-left: 0;
    }
    
    .customer-tracking-pagination {
        flex-direction: column;
    }
    
    .pagination-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}