/**
 * NexDöviz — yorum sistemi genişletme katmanı.
 *
 * NEXY: Yeni dosya. main.css'ten SONRA yüklenir, onu değiştirmez.
 * Derleme (PostCSS/Tailwind) gerektirmez; doğrudan enqueue edilir.
 * Aynı kurallar assets/css/src/components/ altına da kopyalanmıştır ki
 * ileride `npm run build` çalıştırılırsa tutarlılık bozulmasın.
 *
 * Temanın kendi tasarım değişkenlerini (--nex-*) kullanır; hiçbir rengi
 * sabit kodlamaz, böylece tema paleti değişirse otomatik uyum sağlar.
 */

/* -------------------------------------------------------------------------
 * Başlık: başlık solda, sıralama + "Yorum Yaz" sağda
 * ---------------------------------------------------------------------- */

.nex-comments__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--nex-space-3, 0.75rem);
	flex-wrap: wrap;
}

.nex-comments__head-left {
	display: flex;
	align-items: center;
	gap: var(--nex-space-3, 0.75rem);
	min-width: 0;
}

.nex-comments__head-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	flex: 0 0 auto;
	border-radius: var(--nex-radius-lg, 0.75rem);
	background: var(--nex-color-primary-muted, rgba(59, 130, 246, 0.15));
	color: var(--nex-color-primary, #3b82f6);
}

.nex-comments__head-right {
	display: flex;
	align-items: center;
	gap: var(--nex-space-2, 0.5rem);
	flex: 0 0 auto;
}

/* Sıralama açılır kutusu */

.nex-comments__sort {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.nex-comments__sort-select {
	appearance: none;
	-webkit-appearance: none;
	padding: 0.5rem 2rem 0.5rem 0.875rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: var(--nex-font-medium, 500);
	line-height: 1.2;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: var(--nex-color-surface-raised, #141d2e);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-md, 0.5rem);
	cursor: pointer;
	transition: border-color var(--nex-transition-fast, 150ms ease), color var(--nex-transition-fast, 150ms ease);
}

.nex-comments__sort-select:hover {
	color: var(--nex-color-text, #f1f5f9);
	border-color: var(--nex-color-border-strong, #2d3f5c);
}

.nex-comments__sort-select:focus-visible {
	outline: 2px solid var(--nex-color-primary, #3b82f6);
	outline-offset: 2px;
}

.nex-comments__sort-caret {
	position: absolute;
	right: 0.625rem;
	pointer-events: none;
	color: var(--nex-color-text-secondary, #94a3b8);
}

/* "Yorum Yaz" butonu */

.nex-comments__write {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.9rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: var(--nex-font-semibold, 600);
	line-height: 1.2;
	color: var(--nex-color-text-on-accent, #fff);
	background: var(--nex-color-primary, #3b82f6);
	border: 0;
	border-radius: var(--nex-radius-md, 0.5rem);
	cursor: pointer;
	transition: background var(--nex-transition-fast, 150ms ease);
}

.nex-comments__write:hover {
	background: var(--nex-color-primary-hover, #2563eb);
}

.nex-comments__write:focus-visible {
	outline: 2px solid var(--nex-color-primary, #3b82f6);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Sembol rozeti (USD/TRY)
 * ---------------------------------------------------------------------- */

.nex-comment__symbol {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: var(--nex-font-semibold, 600);
	line-height: 1.4;
	white-space: nowrap;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: var(--nex-color-surface-raised, #141d2e);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-md, 0.5rem);
	text-decoration: none;
	transition: color var(--nex-transition-fast, 150ms ease), border-color var(--nex-transition-fast, 150ms ease);
}

.nex-comment__symbol:hover {
	color: var(--nex-color-text, #f1f5f9);
	border-color: var(--nex-color-border-strong, #2d3f5c);
}

.nex-comment__symbol-icon {
	font-size: 0.9375rem;
	line-height: 1;
}

/* Üst satır: yazar, tarih, sağda rozet + ⋮ */

.nex-comment__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	width: 100%;
}

.nex-comment__aside {
	display: flex;
	align-items: center;
	gap: var(--nex-space-2, 0.5rem);
	flex: 0 0 auto;
	margin-inline-start: auto;
}

/* -------------------------------------------------------------------------
 * ⋮ menüsü
 * ---------------------------------------------------------------------- */

.nex-comment__menu {
	position: relative;
	flex: 0 0 auto;
}

.nex-comment__menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: transparent;
	border: 0;
	border-radius: var(--nex-radius-sm, 0.375rem);
	cursor: pointer;
	transition: background var(--nex-transition-fast, 150ms ease), color var(--nex-transition-fast, 150ms ease);
}

.nex-comment__menu-toggle:hover {
	color: var(--nex-color-text, #f1f5f9);
	background: var(--nex-color-surface-overlay, #1a2438);
}

.nex-comment__menu-list {
	position: absolute;
	top: calc(100% + 0.25rem);
	right: 0;
	z-index: 30;
	min-width: 11rem;
	padding: 0.25rem;
	margin: 0;
	list-style: none;
	background: var(--nex-color-surface-overlay, #1a2438);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-md, 0.5rem);
	box-shadow: var(--nex-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.32));
}

.nex-comment__menu-item {
	display: block;
	width: 100%;
	padding: 0.5rem 0.625rem;
	font-family: inherit;
	font-size: 0.8125rem;
	text-align: start;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: transparent;
	border: 0;
	border-radius: var(--nex-radius-sm, 0.375rem);
	cursor: pointer;
}

.nex-comment__menu-item:hover {
	color: var(--nex-color-text, #f1f5f9);
	background: var(--nex-color-surface-raised, #141d2e);
}

.nex-comment__menu-item--danger:hover {
	color: var(--nex-color-negative, #ef4444);
	background: var(--nex-color-negative-muted, rgba(239, 68, 68, 0.14));
}

/* -------------------------------------------------------------------------
 * Yoruma eklenen görsel
 * ---------------------------------------------------------------------- */

.nex-comment__image {
	display: block;
	margin-top: var(--nex-space-3, 0.75rem);
	max-width: min(20rem, 100%);
	border-radius: var(--nex-radius-lg, 0.75rem);
	overflow: hidden;
	border: 1px solid var(--nex-color-border, #1e2a3f);
}

.nex-comment__image img {
	display: block;
	width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------------
 * Kompozer eklentileri: görsel, misafir alanları, sembol seçimi
 * ---------------------------------------------------------------------- */

.nex-comment-form__guest {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: var(--nex-space-2, 0.5rem);
	margin-bottom: var(--nex-space-2, 0.5rem);
}

.nex-comment-form__guest-input,
.nex-comment-form__symbol {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-family: inherit;
	font-size: 0.875rem;
	color: var(--nex-color-text, #f1f5f9);
	background: var(--nex-color-surface-muted, #111827);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-md, 0.5rem);
}

.nex-comment-form__guest-input::placeholder {
	color: var(--nex-color-text-secondary, #94a3b8);
}

.nex-comment-form__guest-input:focus,
.nex-comment-form__symbol:focus {
	outline: none;
	border-color: var(--nex-color-primary, #3b82f6);
}

.nex-comment-form__symbol-row {
	margin-bottom: var(--nex-space-2, 0.5rem);
}

.nex-comment-form__image-preview {
	position: relative;
	display: inline-block;
	margin-top: var(--nex-space-2, 0.5rem);
	max-width: 12rem;
	border-radius: var(--nex-radius-md, 0.5rem);
	overflow: hidden;
	border: 1px solid var(--nex-color-border, #1e2a3f);
}

.nex-comment-form__image-preview img {
	display: block;
	width: 100%;
	height: auto;
}

.nex-comment-form__image-remove {
	position: absolute;
	top: 0.25rem;
	right: 0.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	font-size: 0.875rem;
	line-height: 1;
	color: #fff;
	background: rgba(0, 0, 0, 0.65);
	border: 0;
	border-radius: var(--nex-radius-full, 9999px);
	cursor: pointer;
}

.nex-comment-form__image-remove:hover {
	background: var(--nex-color-negative, #ef4444);
}

.nex-comment-form__file {
	display: none;
}

.nex-comment-form__tool[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Ana sayfa ortak akışı
 * ---------------------------------------------------------------------- */

.nex-comments--feed {
	margin-top: var(--nex-space-6, 1.5rem);
}

.nex-comments--feed .nex-comment__symbol {
	display: inline-flex;
}

/* Akışta yanıt ağacı sadeleşir */

.nex-comments--feed .nex-comment__replies {
	display: none;
}

.nex-comments__feed-more {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: var(--nex-space-3, 0.75rem);
	font-size: 0.8125rem;
	font-weight: var(--nex-font-medium, 500);
	color: var(--nex-color-primary, #3b82f6);
	text-decoration: none;
}

.nex-comments__feed-more:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Yorum listesi: tasarımdaki gibi tek çerçeveli kutu, aralarında ayraç
 * ---------------------------------------------------------------------- */

.nexy-list--boxed {
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-lg, 0.75rem);
	background: var(--nex-color-surface, #0f1624);
	overflow: hidden;
}

.nexy-list--boxed > .nex-comment {
	margin: 0;
	padding: 1.1rem 1.15rem;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.nexy-list--boxed > .nex-comment + .nex-comment {
	border-top: 1px solid var(--nex-color-border, #1e2a3f);
}

.nexy-list--boxed > .nex-comment:hover {
	background: rgba(148, 163, 184, 0.035);
}

/*
 * Avatar: iki harfli, kişiye göre renkli.
 *
 * DİKKAT: tema .nex-comment__main'i GRID olarak kuruyor ve ilk sütunu sabit
 * genişlikte veriyor (masaüstü 2.65rem, mobil 2.25rem). Avatar büyütülürken
 * sütun da büyütülmezse avatar ikinci sütunun üstüne taşıp metinle çakışır.
 * Bu yüzden ikisini birlikte tanımlıyoruz.
 */

.nex-comments .nex-comment__main {
	grid-template-columns: 2.75rem minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
}

.nex-comment__avatar--fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	font-size: 0.9375rem;
	font-weight: var(--nex-font-semibold, 600);
	letter-spacing: 0.01em;
	color: #fff;
	border-radius: var(--nex-radius-full, 9999px);
}

.nex-comment__avatar-wrap,
.nex-comment__avatar {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--nex-radius-full, 9999px);
}

.nex-comment__author {
	font-weight: var(--nex-font-semibold, 600);
}

.nex-comment__like-svg {
	display: block;
}

.nex-comment__action--like {
	color: var(--nex-color-positive, #22c55e);
	font-weight: var(--nex-font-semibold, 600);
}

/* -------------------------------------------------------------------------
 * Kompozer: solda avatar, ortada input, sağda Gönder
 * ---------------------------------------------------------------------- */

.nexy-composer__row {
	display: flex;
	align-items: flex-end;
	gap: 0.75rem;
}

.nexy-composer__avatar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	overflow: hidden;
	font-size: 0.9375rem;
	font-weight: var(--nex-font-semibold, 600);
	color: var(--nex-color-text-secondary, #94a3b8);
	background: var(--nex-color-surface-raised, #141d2e);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-full, 9999px);
}

.nexy-composer__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nexy-composer__field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	background: var(--nex-color-surface-muted, #111827);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-lg, 0.75rem);
	transition: border-color var(--nex-transition-fast, 150ms ease);
}

.nexy-composer__field:focus-within {
	border-color: var(--nex-color-primary, #3b82f6);
}

.nexy-composer .nex-comment-form__input {
	flex: 1 1 auto;
	min-height: 2.75rem;
	max-height: 11.875rem;
	padding: 0.8rem 0.25rem 0.8rem 1rem;
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: var(--nex-color-text, #f1f5f9);
	background: transparent;
	border: 0;
	border-radius: 0;
	resize: none;
	overflow-y: auto;
}

.nexy-composer .nex-comment-form__input:focus {
	outline: none;
	box-shadow: none;
}

.nexy-composer .nex-comment-form__tools {
	position: static;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.15rem;
	padding-right: 0.65rem;
	margin: 0;
}

.nexy-composer .nex-comment-form__tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	padding: 0;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: transparent;
	border: 0;
	border-radius: var(--nex-radius-md, 0.5rem);
	cursor: pointer;
}

.nexy-composer .nex-comment-form__tool:hover {
	background: rgba(148, 163, 184, 0.10);
}

.nexy-composer .nex-comment-form__emoji-panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.5rem);
	z-index: 40;
	width: min(20rem, 78vw);
	max-height: 12rem;
	overflow-y: auto;
	padding: 0.5rem;
	background: var(--nex-color-surface-overlay, #1a2438);
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-lg, 0.75rem);
	box-shadow: var(--nex-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.32));
}

.nexy-composer .nex-comment-form__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.nexy-composer .nex-comment-form__submit {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	height: 2.75rem;
	padding: 0 1.15rem;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: var(--nex-font-semibold, 600);
	color: var(--nex-color-text-on-accent, #fff);
	background: var(--nex-color-primary, #3b82f6);
	border: 0;
	border-radius: var(--nex-radius-lg, 0.75rem);
	cursor: pointer;
}

.nexy-composer .nex-comment-form__submit:hover {
	background: var(--nex-color-primary-hover, #2563eb);
}

.nexy-composer .nex-comment-form__submit::before {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m22 2-7 20-4-9-9-4z'/><path d='M22 2 11 13'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m22 2-7 20-4-9-9-4z'/><path d='M22 2 11 13'/></svg>") center / contain no-repeat;
}

.nexy-composer__counter {
	position: absolute;
	right: 0.75rem;
	bottom: -1.35rem;
	font-size: 0.75rem;
	color: var(--nex-color-text-secondary, #94a3b8);
}

.nexy-composer .nex-comment-form__cancel {
	height: 2.75rem;
	padding: 0 0.9rem;
	font-family: inherit;
	font-size: 0.9375rem;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: transparent;
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-lg, 0.75rem);
	cursor: pointer;
}

@media (max-width: 640px) {
	.nexy-composer .nex-comment-form__submit {
		padding: 0 0.85rem;
		font-size: 0;
		gap: 0;
	}

	.nexy-composer .nex-comment-form__submit::before {
		width: 18px;
		height: 18px;
	}

	.nexy-composer__avatar {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * Boş durum
 * ---------------------------------------------------------------------- */

.nex-comments__empty--rich {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: var(--nex-space-8, 2rem) var(--nex-space-4, 1rem);
	text-align: center;
}

.nex-comments__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin-bottom: 0.25rem;
	color: var(--nex-color-primary, #3b82f6);
	background: var(--nex-color-primary-muted, rgba(59, 130, 246, 0.15));
	border-radius: var(--nex-radius-full, 9999px);
}

.nex-comments__empty-title {
	font-size: 0.9375rem;
	font-weight: var(--nex-font-semibold, 600);
	color: var(--nex-color-text, #f1f5f9);
}

.nex-comments__empty-hint {
	max-width: 34rem;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: var(--nex-color-text-secondary, #94a3b8);
}

.nex-comments__empty-cta {
	margin-top: 0.5rem;
	padding: 0.5rem 1rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: var(--nex-font-semibold, 600);
	color: var(--nex-color-text-on-accent, #fff);
	background: var(--nex-color-primary, #3b82f6);
	border: 0;
	border-radius: var(--nex-radius-md, 0.5rem);
	cursor: pointer;
	transition: background var(--nex-transition-fast, 150ms ease);
}

.nex-comments__empty-cta:hover {
	background: var(--nex-color-primary-hover, #2563eb);
}

.nex-comments__empty-cta:focus-visible {
	outline: 2px solid var(--nex-color-primary, #3b82f6);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Onay bekleyen yorum bilgilendirmesi
 * ---------------------------------------------------------------------- */

.nex-comments__notice {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.75rem 0.875rem;
	margin-top: var(--nex-space-3, 0.75rem);
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--nex-color-text-secondary, #94a3b8);
	background: var(--nex-color-primary-muted, rgba(59, 130, 246, 0.15));
	border: 1px solid var(--nex-color-border, #1e2a3f);
	border-radius: var(--nex-radius-md, 0.5rem);
}

.nex-comment--pending {
	opacity: 0.72;
}

.nex-comment__pending-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.125rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: var(--nex-font-semibold, 600);
	color: var(--nex-color-warning, #f59e0b);
	background: rgba(245, 158, 11, 0.14);
	border-radius: var(--nex-radius-full, 9999px);
}

/* -------------------------------------------------------------------------
 * Küçük ekran
 * ---------------------------------------------------------------------- */

@media (max-width: 640px) {
	.nex-comments__header {
		align-items: flex-start;
	}

	.nex-comments__head-right {
		width: 100%;
		justify-content: space-between;
	}

	.nex-comment__aside {
		gap: 0.25rem;
	}

	.nex-comment__symbol {
		padding: 0.2rem 0.5rem;
		font-size: 0.6875rem;
		gap: 0.3rem;
	}

	.nex-comments .nex-comment__main {
		grid-template-columns: 2.5rem minmax(0, 1fr);
		gap: 0.7rem;
	}

	.nex-comment__avatar-wrap,
	.nex-comment__avatar,
	.nex-comment__avatar--fallback {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 0.875rem;
	}

	.nexy-list--boxed > .nex-comment {
		padding: 0.95rem 0.85rem;
	}
}

/* -------------------------------------------------------------------------
 * Açık tema uyumu (temanın html.nex-theme-light kancasını izler)
 * ---------------------------------------------------------------------- */

html.nex-theme-light .nex-comments__sort-select,
html.nex-theme-light .nex-comment__symbol,
html.nex-theme-light .nex-comment-form__guest-input,
html.nex-theme-light .nex-comment-form__symbol {
	background: #fff;
	color: #334155;
	border-color: #e2e8f0;
}

html.nex-theme-light .nex-comment__menu-list {
	background: #fff;
	border-color: #e2e8f0;
}

html.nex-theme-light .nex-comment__menu-item {
	color: #475569;
}

html.nex-theme-light .nex-comment__menu-item:hover {
	color: #0f172a;
	background: #f1f5f9;
}
