/* استایل‌های سیستم تیکت - فرانت‌اند */

.ats-container {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 30px;
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.ats-header h2 {
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ats-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ats-btn i {
    font-size: 14px;
}

.ats-btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.ats-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2573a7 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.ats-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.ats-btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

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

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

.ats-btn-view {
    background: #6c757d;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.ats-btn-view:hover {
    background: #5a6268;
    color: white;
}

.ats-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 40px;
}

.ats-btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.ats-btn-back {
    background: none;
    color: #6c757d;
    padding: 8px 15px;
    border: 1px solid #dee2e6;
}

.ats-btn-back:hover {
    background: #f8f9fa;
    color: #495057;
}

.ats-notice {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.ats-table-responsive {
    overflow-x: auto;
}

.ats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ats-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: right;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}

.ats-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #6c757d;
    vertical-align: middle;
}

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

.ats-ticket-row:hover {
    transform: translateX(-5px);
    transition: transform 0.3s ease;
}

.ats-ticket-title {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
}

.ats-ticket-title:hover {
    color: #3498db;
    text-decoration: underline;
}

.ats-program-tag, .ats-program-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f4fc;
    color: #2980b9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ats-program-badge {
    font-size: 14px;
    padding: 6px 12px;
}

.ats-no-program {
    color: #95a5a6;
    font-style: italic;
    font-size: 13px;
}

.ats-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ats-badge-open {
    background: #fff3cd;
    color: #856404;
}

.ats-badge-progress {
    background: #cce5ff;
    color: #004085;
}

.ats-badge-answered {
    background: #d4edda;
    color: #155724;
}

.ats-badge-closed {
    background: #f8d7da;
    color: #721c24;
}

.ats-badge-low {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.ats-badge-medium {
    background: #ffeaa7;
    color: #856404;
}

.ats-badge-high {
    background: #ffcccc;
    color: #721c24;
}

.ats-badge-urgent {
    background: #dc3545;
    color: white;
}

.ats-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.ats-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    margin: 40px 0;
}

.ats-empty-state i {
    margin-bottom: 20px;
    opacity: 0.5;
}

.ats-empty-state h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.ats-empty-state p {
    margin-bottom: 20px;
}

.ats-ticket-conversation {
    background: #fff;
    border-radius: 12px;
}

.ats-ticket-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #dee2e6;
}

.ats-ticket-header h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.ats-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.ats-messages-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.ats-message {
    margin-bottom: 20px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ats-message-user {
    margin-right: auto;
}

.ats-message-admin {
    margin-left: auto;
}

.ats-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.ats-message-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.ats-message-time {
    color: #95a5a6;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ats-message-body {
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    line-height: 1.8;
}

.ats-message-user .ats-message-body {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.ats-message-admin .ats-message-body {
    background: #f1f8e9;
    border-color: #dcedc8;
}

.ats-attachment {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ats-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.ats-attachment-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.ats-reply-form {
    padding: 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #dee2e6;
}

.ats-reply-form h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.ats-label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ats-input, .ats-textarea, .ats-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.ats-input:focus, .ats-textarea:focus, .ats-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.ats-textarea {
    resize: vertical;
    min-height: 120px;
}

.ats-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
    padding-left: 40px;
}

.ats-file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.ats-file-input:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.ats-help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

.ats-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.ats-new-ticket {
    background: white;
    border-radius: 12px;
    padding: 30px;
}

.ats-form {
    margin-top: 20px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

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

.status-waiting-payment {
    background: #cce5ff;
    color: #004085;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 768px) {
    .ats-container {
        padding: 20px;
        margin: 15px;
    }
    
    .ats-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ats-table {
        font-size: 14px;
    }
    
    .ats-table th, .ats-table td {
        padding: 10px;
    }
    
    .ats-message {
        max-width: 100%;
    }
    
    .ats-form-actions {
        flex-direction: column;
    }
    
    .ats-btn {
        width: 100%;
        justify-content: center;
    }
}