/* SMFO Currency module — minfin-style cards + sortable table */

.smfo-currency {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	color: #1f2937;
	max-width: 1200px;
	margin: 0 auto;
}

/* Header */
.smfo-currency-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.smfo-currency-title {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	color: #111827;
	letter-spacing: -0.01em;
}

.smfo-currency-meta {
	margin: 4px 0 0;
	font-size: 13px;
	color: #6b7280;
}

.smfo-currency-search-wrap {
	flex: 1;
	min-width: 280px;
	max-width: 380px;
}

.smfo-currency-search {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}

.smfo-currency-search:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* Hero cards */
.smfo-currency-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 14px;
	margin-bottom: 28px;
}

.smfo-currency-card {
	background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px 18px;
	transition: transform .15s, box-shadow .15s;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.smfo-currency-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	border-color: #d1d5db;
}

.smfo-currency-card-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.smfo-currency-flag {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f3f4f6;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	color: #4b5563;
}

.smfo-currency-flag-usd { background: linear-gradient(135deg, #1e40af, #2563eb); color: #fff; }
.smfo-currency-flag-usd::before { content: "$"; font-size: 18px; }
.smfo-currency-flag-eur { background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: #fcd34d; }
.smfo-currency-flag-eur::before { content: "€"; font-size: 18px; }
.smfo-currency-flag-pln { background: linear-gradient(135deg, #dc2626, #fff); color: #dc2626; }
.smfo-currency-flag-pln::before { content: "PL"; font-size: 12px; }
.smfo-currency-flag-gbp { background: linear-gradient(135deg, #1e293b, #475569); color: #fff; }
.smfo-currency-flag-gbp::before { content: "£"; font-size: 18px; }
.smfo-currency-flag-chf { background: linear-gradient(135deg, #dc2626, #fff); color: #dc2626; }
.smfo-currency-flag-chf::before { content: "₣"; font-size: 16px; }

.smfo-currency-cc {
	font-size: 13px;
	font-weight: 700;
	color: #6b7280;
	letter-spacing: 0.05em;
}

.smfo-currency-name {
	font-size: 12px;
	color: #9ca3af;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.smfo-currency-card-body {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
}

.smfo-currency-rate {
	font-size: 26px;
	font-weight: 700;
	color: #111827;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}

.smfo-currency-uah {
	font-size: 16px;
	color: #6b7280;
	margin-left: 4px;
	font-weight: 500;
}

.smfo-currency-change {
	font-size: 13px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
}

.smfo-currency-change-up   { background: #d1fae5; color: #065f46; }
.smfo-currency-change-down { background: #fee2e2; color: #991b1b; }
.smfo-currency-change-flat { background: #f3f4f6; color: #6b7280; }

/* Table */
.smfo-currency-table-wrap {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.smfo-currency-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.smfo-currency-table thead {
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}

.smfo-currency-table th {
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
	color: #374151;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	user-select: none;
}

.smfo-currency-th-num {
	text-align: right;
}

.smfo-currency-th-sort {
	cursor: pointer;
	transition: background-color .15s;
}

.smfo-currency-th-sort:hover {
	background: #f3f4f6;
}

.smfo-currency-sort-icon {
	font-size: 11px;
	color: #9ca3af;
	margin-left: 4px;
}

.smfo-currency-th-sort.smfo-active-asc  .smfo-currency-sort-icon::after { content: " ▲"; color: #2563eb; }
.smfo-currency-th-sort.smfo-active-desc .smfo-currency-sort-icon::after { content: " ▼"; color: #2563eb; }
.smfo-currency-th-sort.smfo-active-asc  .smfo-currency-sort-icon,
.smfo-currency-th-sort.smfo-active-desc .smfo-currency-sort-icon { font-size: 0; }

.smfo-currency-table tbody tr {
	border-bottom: 1px solid #f3f4f6;
	transition: background-color .12s;
}

.smfo-currency-table tbody tr:last-child { border-bottom: none; }

.smfo-currency-table tbody tr:hover {
	background: #f9fafb;
}

.smfo-currency-table td {
	padding: 12px 16px;
}

.smfo-currency-td-cc {
	font-size: 13px;
	color: #2563eb;
	letter-spacing: 0.04em;
}

.smfo-currency-td-name {
	color: #374151;
}

.smfo-currency-td-rate {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: #111827;
}

.smfo-currency-td-change {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	font-size: 13px;
}

.smfo-currency-td-change.smfo-currency-change-up   { color: #065f46; }
.smfo-currency-td-change.smfo-currency-change-down { color: #991b1b; }
.smfo-currency-td-change.smfo-currency-change-flat { color: #6b7280; }

/* Hidden by search */
.smfo-currency-table tbody tr.smfo-hidden { display: none; }

/* Disclaimer + error */
.smfo-currency-disclaimer {
	margin-top: 16px;
	font-size: 12px;
	color: #6b7280;
	font-style: italic;
	line-height: 1.5;
}

.smfo-currency-error {
	background: #fef3c7;
	border-left: 4px solid #f59e0b;
	padding: 14px 18px;
	border-radius: 6px;
	color: #78350f;
	font-size: 14px;
}

/* Crypto-specific */
.smfo-crypto-logo {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f3f4f6;
	flex-shrink: 0;
}

.smfo-crypto-logo-sm {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	vertical-align: middle;
	margin-right: 8px;
}

.smfo-crypto-rank {
	color: #9ca3af;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	width: 40px;
}

.smfo-crypto-name-cell {
	display: flex;
	align-items: center;
	gap: 0;
}

.smfo-crypto-name-text strong {
	display: block;
	font-size: 14px;
	color: #111827;
	line-height: 1.2;
}

.smfo-crypto-name-text small {
	display: block;
	font-size: 11px;
	color: #9ca3af;
	letter-spacing: 0.04em;
	font-weight: 600;
	margin-top: 2px;
}

.smfo-crypto-cap {
	color: #4b5563;
	font-weight: 500 !important;
}

/* Converter */
.smfo-converter {
	max-width: 600px;
	margin: 0 auto;
}

.smfo-converter-card {
	background: linear-gradient(135deg, #ffffff, #f9fafb);
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px 28px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.smfo-converter-title {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: #111827;
}

.smfo-converter-meta {
	margin: 0 0 20px;
	font-size: 13px;
	color: #6b7280;
}

.smfo-converter-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	align-items: end;
	margin-bottom: 18px;
}

.smfo-converter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.smfo-converter-field label {
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.smfo-converter-input,
.smfo-converter-select {
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 16px;
	background: #fff;
	font-variant-numeric: tabular-nums;
	transition: border-color .15s, box-shadow .15s;
	width: 100%;
	box-sizing: border-box;
}

.smfo-converter-input:focus,
.smfo-converter-select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.smfo-converter-swap {
	grid-column: 1 / -1;
	width: 44px;
	height: 44px;
	margin: 0 auto;
	border: 1px solid #d1d5db;
	border-radius: 50%;
	background: #fff;
	font-size: 20px;
	cursor: pointer;
	color: #2563eb;
	transition: all .15s;
}

.smfo-converter-swap:hover {
	transform: rotate(180deg);
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
}

.smfo-converter-result {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 12px;
	padding: 18px 22px;
	font-size: 32px;
	font-weight: 700;
	color: #0c4a6e;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
	text-align: center;
}

.smfo-converter-result [data-role="result-cc"] {
	font-size: 20px;
	color: #0369a1;
	margin-left: 8px;
	font-weight: 500;
}

.smfo-converter-rate-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: #6b7280;
	text-align: center;
}

/* Mobile */
@media (max-width: 640px) {
	.smfo-currency-title { font-size: 22px; }
	.smfo-currency-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
	.smfo-currency-card { padding: 12px 14px; }
	.smfo-currency-rate { font-size: 22px; }
	.smfo-currency-table { font-size: 13px; }
	.smfo-currency-table th,
	.smfo-currency-table td { padding: 10px 12px; }
	.smfo-currency-td-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
