/* استایل کلی */
.sms-group-sender {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    direction: rtl;
}

.sms-group-sender h3 {
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* بخش فیلتر */
.sms-filter-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sms-filter-section label {
    font-weight: bold;
    color: #495057;
    margin-left: 10px;
}

#group-filter {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    background: #fff;
}

#group-filter:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.filter-count {
    font-weight: bold;
    color: #28a745;
    margin-right: 10px;
}

#contact-count {
    font-size: 16px;
}

/* کنترل‌ها */
.sms-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 10px;
    background: #f1f3f5;
    border-radius: 5px;
}

.sms-controls button {
    padding: 6px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-select {
    background: #28a745;
    color: #fff;
}

.btn-select:hover {
    background: #218838;
}

.btn-deselect {
    background: #dc3545;
    color: #fff;
}

.btn-deselect:hover {
    background: #c82333;
}

.selected-count {
    font-weight: bold;
    color: #495057;
    margin-right: auto;
}

#count-selected {
    color: #007bff;
    font-size: 16px;
}

/* جدول */
.sms-contacts-list {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.sms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sms-table thead {
    background: #343a40;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sms-table th,
.sms-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.sms-table tbody tr:hover {
    background: #f8f9fa;
    cursor: pointer;
}

.sms-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.sms-table tbody tr:nth-child(even):hover {
    background: #e9ecef;
}

.sms-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* بخش پیام */
.sms-message-area {
    margin: 20px 0;
}

.sms-message-area label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

#sms-message {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#sms-message:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.char-counter {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
    text-align: left;
}

#char-count,
#sms-parts {
    font-weight: bold;
    color: #495057;
}

/* دکمه ارسال */
.sms-submit {
    text-align: center;
    margin-top: 20px;
}

.btn-send {
    padding: 12px 40px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838, #17a2b8);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* اعلان‌ها */
.sms-notice {
    padding: 12px 18px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}

.sms-notice.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sms-notice.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sms-notice.empty,
.sms-notice.limit {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* وضعیت خطا */
.sms-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

/* پاسخگو برای موبایل */
@media (max-width: 768px) {
    .sms-group-sender {
        padding: 10px;
    }
    
    .sms-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    #group-filter {
        min-width: 100%;
    }
    
    .sms-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selected-count {
        text-align: center;
        margin-right: 0;
    }
    
    .sms-table {
        font-size: 12px;
    }
    
    .sms-table th,
    .sms-table td {
        padding: 6px 8px;
    }
    
    .btn-send {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* اسکرول بار */
.sms-contacts-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sms-contacts-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.sms-contacts-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.sms-contacts-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* انیمیشن لودر */
#contacts-loader span {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
/* اضافه کردن به فایل CSS موجود */

/* استایل برای حالت خالی بودن جدول */
.sms-table tbody tr td[colspan="5"] {
    font-size: 16px;
    color: #6c757d;
}

.sms-table tbody tr td[colspan="5"]:before {
    content: "📋 ";
}

/* استایل برای المان‌های غیرفعال */
.sms-table thead th input[type="checkbox"]:disabled,
.sms-table tbody td input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.sms-table tbody tr.disabled-row {
    opacity: 0.6;
    pointer-events: none;
}

/* بهبود ظاهر پیام خالی */
.empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 50px 20px;
    color: #6c757d;
    font-size: 18px;
}

.empty-message .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.empty-message .text {
    display: block;
}
/* اضافه شدن به فایل style.css موجود */

/* بهبود نمایش برای پیام‌های وضعیت */
.sms-notice.partial {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* استایل برای بارگذاری بهتر */
#contacts-loader span {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}