/**
 * Customer Messages CSS
 * Müşteri mesaj paneli stilleri
 */

/* Portal Section */
.messages-section {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.messages-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.messages-header h3 {
	margin: 0;
	color: #333;
	font-size: 1.5em;
}

/* Messages List */
.messages-list {
	min-height: 200px;
}

.message-item {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 15px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.message-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	flex-wrap: wrap;
	gap: 8px;
}

.message-id {
	font-weight: 600;
	color: #2271b1;
	font-size: 0.9em;
	background: #e7f3ff;
	padding: 4px 8px;
	border-radius: 4px;
}

.status-badge-new {
	background: #ff9800;
	color: white;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	white-space: nowrap;
}

.message-item:hover {
	background: #f0f0f0;
	border-color: #2271b1;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-item.unread {
	background: #fff8e1;
	border-left: 4px solid #ff9800;
}

.message-info {
	margin-bottom: 8px;
}

.message-subject {
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.message-meta {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	font-size: 0.9em;
	color: #666;
	margin-top: 8px;
}

.message-meta span {
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.85em;
}

.message-category {
	background: #e7f3ff;
	color: #2271b1;
	font-weight: 500;
	border: 1px solid #b3d9ff;
}

.message-category.category-booking {
	background: #fff3cd;
	color: #856404;
	border-color: #ffeaa7;
}

.message-category.category-support {
	background: #d1ecf1;
	color: #0c5460;
	border-color: #bee5eb;
}

.message-category.category-general {
	background: #e9ecef;
	color: #495057;
	border-color: #ced4da;
}

.message-date {
	display: flex;
	gap: 8px;
	align-items: center;
}

.message-date .date-relative {
	background: #e7f3ff;
	color: #2271b1;
	border: 1px solid #b3d9ff;
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 500;
	font-size: 0.85em;
	white-space: nowrap;
}

.message-date .date-full {
	background: #f8f9fa;
	color: #6c757d;
	border: 1px solid #dee2e6;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.85em;
	white-space: nowrap;
}

.message-meta .status {
	background: #d1ecf1;
	color: #0c5460;
}

.message-meta .date {
	background: #f8d7da;
	color: #721c24;
}

.message-preview {
	color: #666;
	font-size: 0.9em;
	line-height: 1.4;
	margin-top: 8px;
}

/* Message Thread */
.message-thread {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
}

.thread-header {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.thread-header h4 {
	margin: 0;
	color: #333;
}

.back-to-list {
	background: #6c757d;
	color: white;
	border: none;
	padding: 8px 15px;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	font-size: 0.9em;
}

.back-to-list:hover {
	background: #5a6268;
	color: white;
}

.thread-messages {
	margin-bottom: 20px;
}

.thread-message {
	margin-bottom: 20px;
	padding: 15px;
	border-radius: 6px;
	border: 1px solid #eee;
}

.thread-message.customer {
	background: #e3f2fd;
	border-left: 4px solid #2196f3;
}

.thread-message.admin {
	background: #e8f5e8;
	border-left: 4px solid #4caf50;
}

.thread-message .message-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.thread-message .message-header strong {
	color: #333;
}

.thread-message .message-date {
	color: #666;
	font-size: 0.9em;
}

.thread-message .message-content {
	line-height: 1.6;
	color: #333;
}

/* Thread Reply */
.thread-reply {
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
}

.form-group {
	margin-bottom: 15px;
}

.form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #333;
}

.form-group textarea {
	width: 100%;
	min-height: 100px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
}

.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

.form-actions .button {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	transition: background-color 0.2s ease;
}

.button-primary {
	background: #2271b1;
	color: white;
}

.button-primary:hover {
	background: #135e96;
	color: white;
}

.button:not(.button-primary) {
	background: #6c757d;
	color: white;
}

.button:not(.button-primary):hover {
	background: #5a6268;
	color: white;
}

/* New Message Form */
.new-message-form {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
	margin-top: 20px;
}

.form-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.form-header h4 {
	margin: 0;
	color: #333;
}

.close-form {
	background: #dc3545;
	color: white;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.close-form:hover {
	background: #c82333;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* No Messages */
.no-messages {
	text-align: center;
	padding: 40px;
	color: #666;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 6px;
}

/* Unread Count Badge */
.unread-count {
	background: #dc3545;
	color: white;
	border-radius: 50%;
	padding: 2px 6px;
	font-size: 0.8em;
	font-weight: bold;
	margin-left: 5px;
	display: none;
}

.unread-count:not(:empty) {
	display: inline-block;
}

/* Loading States */
.loading {
	text-align: center;
	padding: 40px;
	color: #666;
}

.loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #2271b1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-left: 10px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Responsive Design */
@media (max-width: 782px) {
	.messages-header {
		flex-direction: column;
		gap: 15px;
		align-items: stretch;
	}

	.thread-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.message-meta {
		flex-direction: column;
		gap: 5px;
	}

	.form-actions {
		flex-direction: column;
	}

	.form-actions .button {
		width: 100%;
		text-align: center;
	}
}

/* Tab Integration */
.tab-button {
	position: relative;
}

.tab-button .unread-count {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	font-size: 0.7em;
}

/* Success/Error Messages */
.message-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
	padding: 10px 15px;
	margin-bottom: 15px;
}

.message-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	padding: 10px 15px;
	margin-bottom: 15px;
}
