/* استایل‌های عمومی سامانه پیامکی */
.sms-system-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sms-system-container * {
    box-sizing: border-box;
}

.sms-system-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.sms-system-container h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.sms-system-container h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* کادر راهنما */
.sms-system-help-box {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-right: 4px solid #4CAF50;
    border-radius: 4px;
}

.help-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    margin-left: 10px;
    font-weight: bold;
}

.help-content {
    display: inline-block;
}

.help-content p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* کادر موجودی */
.sms-system-balance-box {
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #e8f5e9;
    border-radius: 4px;
    font-size: 16px;
}

.sms-system-balance-box strong {
    font-size: 18px;
    margin: 0 5px;
    color: #4CAF50;
}

/* فرم‌ها */
.sms-system-form {
    margin-bottom: 20px;
}

.sms-system-form .form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
    padding: 0 10px;
}

.sms-system-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.sms-system-form input[type="text"],
.sms-system-form input[type="number"],
.sms-system-form input[type="file"],
.sms-system-form select,
.sms-system-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.sms-system-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.sms-info {
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
}

/* دکمه‌ها */
.sms-system-btn,
.submit-button,
.preview-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.sms-system-btn.primary,
.submit-button {
    background-color: #4CAF50;
    color: white;
}

.sms-system-btn.primary:hover,
.submit-button:hover {
    background-color: #45a049;
}

.sms-system-btn.secondary,
.preview-button {
    background-color: #2196F3;
    color: white;
}

.sms-system-btn.secondary:hover,
.preview-button:hover {
    background-color: #0b7dda;
}

.sms-system-btn.warning {
    background-color: #ff9800;
    color: white;
}

.sms-system-btn.warning:hover {
    background-color: #e68a00;
}

.sms-system-btn.danger {
    background-color: #f44336;
    color: white;
}

.sms-system-btn.danger:hover {
    background-color: #da190b;
}

.sms-system-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

.sms-system-btn:disabled,
.submit-button:disabled,
.preview-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* جداول */
.messages-table-container,
.reports-table-container,
.contacts-table-container,
.recipients-list-container,
.preview-table-container,
.excel-data-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.messages-table,
.reports-table,
.contacts-table,
.recipients-table,
.preview-table,
.excel-data-table,
.numbers-table {
    width: 100%;
    border-collapse: collapse;
}

.messages-table th,
.messages-table td,
.reports-table th,
.reports-table td,
.contacts-table th,
.contacts-table td,
.recipients-table th,
.recipients-table td,
.preview-table th,
.preview-table td,
.excel-data-table th,
.excel-data-table td,
.numbers-table th,
.numbers-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-align: right;
}

.messages-table th,
.reports-table th,
.contacts-table th,
.recipients-table th,
.preview-table th,
.excel-data-table th,
.numbers-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.loading-row,
.empty-row,
.error-row,
.more-rows {
    text-align: center !important;
    padding: 20px !important;
    color: #666;
}

.error-row {
    color: #f44336;
}

.more-rows {
    font-style: italic;
    background-color: #f9f9f9;
}

/* پیام‌ها و آلرت‌ها */
.sms-system-notice,
.sms-system-alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.sms-system-notice {
    background-color: #f9f9f9;
    text-align: center;
    color: #666;
}

.sms-system-alert.success {
    background-color: #dff0d8;
    border-right: 4px solid #3c763d;
    color: #3c763d;
}

.sms-system-alert.error {
    background-color: #f2dede;
    border-right: 4px solid #a94442;
    color: #a94442;
}

.sms-system-alert.warning {
    background-color: #fcf8e3;
    border-right: 4px solid #8a6d3b;
    color: #8a6d3b;
}

/* صفحه‌بندی */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-info {
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    padding: 6px 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #e5e5e5;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* مدال‌ها */
.sms-system-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content.wide {
    max-width: 800px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

/* بخش برآورد هزینه */
.estimate-box {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff8e1;
    border-radius: 4px;
    border-right: 4px solid #ffc107;
}

.estimate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.estimate-info p {
    margin: 0;
    font-weight: bold;
}

.estimate-amount {
    font-size: 16px;
}

/* بخش‌های مخصوص هر صفحه */

/* دفترچه تلفن */
.phonebooks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.phonebook-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

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

.phonebook-header {
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.phonebook-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.phonebook-attributes {
    padding: 15px;
}

.attributes-list {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.attribute-item {
    background-color: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.attribute-item:hover {
    background-color: #c8e6c9;
}

.phonebook-actions {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* وضعیت پیامک‌ها */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-delivered {
    background-color: #dff0d8;
    color: #3c763d;
}

.status-sent {
    background-color: #d9edf7;
    color: #31708f;
}

.status-pending {
    background-color: #fcf8e3;
    color: #8a6d3b;
}

.status-failed {
    background-color: #f2dede;
    color: #a94442;
}

.status-canceled {
    background-color: #f5f5f5;
    color: #777;
}

.status-unknown {
    background-color: #e0e0e0;
    color: #555;
}

/* وب‌سرویس */
.api-credentials {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.credential-row {
    display: flex;
    margin-bottom: 15px;
}

.credential-label {
    flex: 0 0 200px;
    font-weight: bold;
    margin-left: 10px;
}

.credential-value {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.credential-value code {
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    direction: ltr;
    display: inline-block;
    border: 1px solid #ddd;
}

.copy-credential {
    background: none;
    border: none;
    cursor: pointer;
    color: #2196F3;
    padding: 4px;
    margin-right: 10px;
}

.code-section {
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.endpoint-info {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.endpoint-info .method {
    background-color: #4CAF50;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    margin-left: 10px;
}

.code-block {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
    white-space: pre;
    direction: ltr;
    text-align: left;
    line-height: 1.5;
    border: 1px solid #ddd;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .sms-system-container {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        padding: 0;
    }
    
    .phonebooks-container {
        grid-template-columns: 1fr;
    }
    
    .phonebook-actions {
        flex-direction: column;
    }
    
    .phonebook-actions button {
        width: 100%;
    }
    
    .estimate-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .estimate-amount {
        margin-top: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .credential-row {
        flex-direction: column;
    }
    
    .credential-label {
        margin-bottom: 5px;
    }
    
    .messages-table,
    .reports-table,
    .numbers-table {
        min-width: 600px;
    }
    
    .messages-table-container,
    .reports-table-container {
        overflow-x: auto;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        margin-bottom: 5px;
    }
}