/**
 * Comments Module - CSS Styles
 * Supports nested comments with depth-based indentation
 */

/* ========================================
   Comments Section Container
   ======================================== */
.comments-section {
	margin: 2rem 0;
	font-family: inherit;
}

.comments-header {
	margin-bottom: 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e0e0e0;
}

.comments-count {
	font-size: 1.1rem;
	font-weight: 600;
	color: #333;
}

/* ========================================
   Comments List
   ======================================== */
.comments-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ========================================
   Individual Comment
   ======================================== */
.comment {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: #fafafa;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
}

.comment:last-child {
	margin-bottom: 0;
}

/* Depth-based indentation */
.comment-depth-0 {
	margin-left: 0;
}

.comment-depth-1 {
	margin-left: 2rem;
	border-left: 3px solid #d0d0d0;
}

.comment-depth-2 {
	margin-left: 4rem;
	border-left: 3px solid #c0c0c0;
}

.comment-depth-3 {
	margin-left: 5rem;
	border-left: 3px solid #b0b0b0;
}

/* Responsive: reduce indent on mobile */
@media (max-width: 768px) {
	.comment-depth-1 { margin-left: 1rem; }
	.comment-depth-2 { margin-left: 1.5rem; }
	.comment-depth-3 { margin-left: 2rem; }
}

/* ========================================
   Comment Header (Avatar + Meta)
   ======================================== */
.comment-header {
	display: flex;
	align-items: flex-start;
	margin-bottom: 0.75rem;
}

.comment-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	margin-right: 0.75rem;
	flex-shrink: 0;
}

.comment-meta {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.comment-author {
	font-weight: 600;
	color: #333;
}

.comment-author a {
	color: inherit;
	text-decoration: none;
}

.comment-author a:hover {
	text-decoration: underline;
}

.comment-date {
	font-size: 0.85rem;
	color: #666;
}

/* ========================================
   Comment Status Badges
   ======================================== */
.comment-status-badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 500;
	border-radius: 3px;
	text-transform: uppercase;
}

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

/* Owner reply indicator */
.comment-owner {
	background: #f0f7ff;
	border-color: #b8daff;
}

.comment-owner::before {
	content: "Author";
	display: inline-block;
	padding: 0.1rem 0.4rem;
	margin-bottom: 0.5rem;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	background: #007bff;
	color: white;
	border-radius: 3px;
}

/* ========================================
   Comment Content
   ======================================== */
.comment-content {
	line-height: 1.6;
	color: #444;
	word-wrap: break-word;
}

.comment-content p {
	margin: 0 0 0.75rem 0;
}

.comment-content p:last-child {
	margin-bottom: 0;
}

.comment-content a {
	color: #007bff;
	text-decoration: none;
}

.comment-content a:hover {
	text-decoration: underline;
}

/* ========================================
   Comment Actions (Reply button)
   ======================================== */
.comment-actions {
	margin-top: 0.75rem;
	padding-top: 0.5rem;
	border-top: 1px solid #e8e8e8;
}

.comment-reply-btn {
	display: inline-block;
	padding: 0.25rem 0.5rem;
	font-size: 0.85rem;
	color: #666;
	text-decoration: none;
	border: 1px solid #ddd;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
}

.comment-reply-btn:hover {
	color: #333;
	border-color: #999;
	background: #f5f5f5;
}

/* ========================================
   Nested Replies Container
   ======================================== */
.comment-replies {
	margin-top: 1rem;
}

/* Reply form placeholder */
.comment-reply-form {
	margin-top: 1rem;
}

/* ========================================
   Comment Form
   ======================================== */
.comments-form {
	margin-top: 2rem;
	padding: 1.5rem;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 4px;
}

.comments-form-title {
	margin: 0 0 1rem 0;
	font-size: 1.1rem;
	font-weight: 600;
}

.comments-form .form-group {
	margin-bottom: 1rem;
}

.comments-form label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 500;
	color: #333;
}

.comments-form input[type="text"],
.comments-form input[type="email"],
.comments-form textarea {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	border: 1px solid #ced4da;
	border-radius: 4px;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.comments-form input[type="text"]:focus,
.comments-form input[type="email"]:focus,
.comments-form textarea:focus {
	outline: none;
	border-color: #80bdff;
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

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

.comments-form .error {
	border-color: #dc3545;
}

.comments-form .error:focus {
	box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Honeypot field - hidden from users */
.comments-form .hp-field {
	position: absolute;
	left: -9999px;
	opacity: 0;
	pointer-events: none;
}

/* Remember me checkbox */
.comments-form .checkbox-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.comments-form .checkbox-group input[type="checkbox"] {
	width: auto;
}

/* ========================================
   Form Buttons
   ======================================== */
.comments-form-buttons {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.comments-form .btn {
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 500;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.comments-form .btn-primary {
	background: #007bff;
	color: white;
}

.comments-form .btn-primary:hover {
	background: #0056b3;
}

.comments-form .btn-primary:disabled {
	background: #6c757d;
	cursor: not-allowed;
}

.comments-form .btn-secondary {
	background: #6c757d;
	color: white;
}

.comments-form .btn-secondary:hover {
	background: #545b62;
}

/* Cancel reply button */
.comment-cancel-reply {
	margin-left: 0.5rem;
}

/* ========================================
   Form Messages
   ======================================== */
.form-error {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
}

.form-success {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	background: #d4edda;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
	color: #155724;
}

/* ========================================
   Preview
   ======================================== */
#comments-preview,
#CommentsEditPreview {
	padding: 1rem;
	margin-top: 1rem;
	background: #fff;
	border: 1px dashed #ced4da;
	border-radius: 4px;
}

/* ========================================
   Loader
   ======================================== */
.comment-loader,
#CommentsLoader {
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-left: 0.5rem;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #007bff;
	border-radius: 50%;
	animation: comment-spin 1s linear infinite;
}

@keyframes comment-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ========================================
   Inline Reply Form
   ======================================== */
.reply-form-inline {
	margin-top: 1rem;
	padding: 1rem;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.reply-form-inline .comments-form-title {
	font-size: 1rem;
}

/* ========================================
   New Comment Highlight
   ======================================== */
.comment-new {
	animation: comment-highlight 3s ease-out;
}

@keyframes comment-highlight {
	0% { background-color: #ffffcc; }
	100% { background-color: #fafafa; }
}

/* ========================================
   Admin - Status Tabs
   ======================================== */
.comments-status-tabs {
	display: flex;
	gap: 0.25rem;
	margin-bottom: 1rem;
	padding: 0.5rem;
	background: #f8f9fa;
	border-radius: 4px;
}

.status-tab {
	padding: 0.5rem 1rem;
	text-decoration: none;
	color: #495057;
	border-radius: 3px;
	transition: all 0.2s ease;
}

.status-tab:hover {
	background: #e9ecef;
}

.status-tab.active {
	background: #007bff;
	color: white;
}

.status-tab .badge {
	display: inline-block;
	padding: 0.15rem 0.4rem;
	font-size: 0.75rem;
	font-weight: 600;
	background: rgba(0,0,0,0.1);
	border-radius: 10px;
	margin-left: 0.25rem;
}

.status-tab.active .badge {
	background: rgba(255,255,255,0.2);
}

/* ========================================
   Admin - Quick Actions
   ======================================== */
.quick-actions {
	display: flex;
	gap: 0.25rem;
}

.quick-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	font-size: 14px;
	text-decoration: none;
	border-radius: 3px;
	transition: all 0.2s ease;
}

.quick-btn.approve {
	color: #28a745;
}

.quick-btn.approve:hover {
	background: #28a745;
	color: white;
}

.quick-btn.reject {
	color: #dc3545;
}

.quick-btn.reject:hover {
	background: #dc3545;
	color: white;
}

.quick-btn.spam {
	color: #fd7e14;
}

.quick-btn.spam:hover {
	background: #fd7e14;
	color: white;
}

/* ========================================
   Admin - Thread Context
   ======================================== */
.thread-context {
	padding: 0.75rem;
	margin-bottom: 1rem;
	background: #f8f9fa;
	border-left: 3px solid #007bff;
	border-radius: 0 4px 4px 0;
}

.thread-context strong {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	color: #666;
}

.thread-parent {
	margin: 0.25rem 0;
	font-size: 0.9rem;
}

.thread-author {
	font-weight: 600;
}

.thread-excerpt {
	color: #666;
}

/* ========================================
   No Comments Message
   ======================================== */
.no-comments {
	padding: 2rem;
	text-align: center;
	color: #666;
	font-style: italic;
}
