/**
 * Easy Buy/Sell v2 - Isolated styles
 * All classes prefixed with .ebs- to avoid collision with v1
 */

/* ── card container ── */
.ebs-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	padding: 24px;
	max-width: 480px;
	margin: 0 auto;
	position: relative;
}

/* ── segmented tabs ── */
.ebs-tabs {
	display: flex;
	background: #fff;
	border-radius: 10px;
	padding: 4px;
	margin-bottom: 24px;
	border: 1px solid #D5D7DA;
}

.ebs-tab {
	flex: 1;
	text-align: center;
	padding: 12px 0;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 16px;
	color: #666;
	background: #fff;
	border: none;
	transition: all 0.2s ease;
}

.ebs-tab.active {
	background: #D3E2F0;
	color: #1a1a2e;
	border: none;
	box-shadow: none;
	outline: none;
}

.ebs-tab:focus {
	outline: none;
}

/* ── balance display ── */
.ebs-balance {
	text-align: center;
	margin-bottom: 24px;
}

.ebs-balance-amount {
	font-size: 28px;
	font-weight: 700;
	color: #1a1a2e;
	margin-bottom: 4px;
}

.ebs-balance-label {
	font-size: 13px;
	color: #888;
}

/* ── input sections (pay with / buy / sell / receive) ── */
.ebs-section {
	background: #f8f9fa;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 8px;
}

.ebs-section-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
}

.ebs-section-label {
	font-size: 13px;
	color: #888;
	font-weight: 500;
}

.ebs-section-body {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* ── coin selector ── */
.ebs-coin-select {
	display: flex;
	align-items: center;
    gap: 6px !important;
	cursor: default;
	min-width: 100px;
}

.ebs-coin-select .custom-dropdown {
	cursor: pointer;
}

.ebs-coin-select img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}

.ebs-coin-name {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a2e;
}

.ebs-coin-select .fa-chevron-down {
	font-size: 12px;
	color: #888;
	margin-left: 4px;
}

/* coin dropdown slot — reset v1 leaking padding */
.ebs-coin-dropdown-slot {
	padding: 0 !important;
	margin: 0 !important;
}

/* coin dropdown integration — reset Bootstrap btn-group */
.ebs-coin-select .custom-dropdown,
.ebs-coin-select .custom-dropdown.btn-group {
	display: flex !important;
	align-items: center;
	position: relative;
	border: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.ebs-coin-select .custom-dropdown .btn,
.ebs-coin-select .custom-dropdown .btn.dropdown-toggle {
	padding: 0 !important;
	margin: 0 !important;
	gap: 6px !important;
	font-size: 18px;
	font-weight: 600;
	display: flex !important;
	align-items: center;
	border: none !important;
	background: transparent !important;
	color: #1a1a2e;
	box-shadow: none !important;
	line-height: inherit !important;
}

.ebs-coin-select .dropdown-toggle::after {
	display: none !important;
}

.ebs-coin-select .custom-dropdown .btn img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	margin: 0 !important;
}

/* override v1 leaking styles (altcointrader.*.css) */
#buyEstimateView,
#sellEstimateView {
	background-color: transparent !important;
	border: none !important;
}

#buyEstimateView .ebs-coin-dropdown-slot .custom-dropdown,
#sellTickerView.ebs-coin-dropdown-slot .custom-dropdown {
	display: flex !important;
}

#buyEstimateView .ebs-coin-dropdown-slot .custom-dropdown .btn,
#sellTickerView.ebs-coin-dropdown-slot .custom-dropdown .btn {
	display: flex !important;
}

#buyEstimateView img,
#sellTickerView img {
	margin: 0 !important;
}

.ebs-coin-select .dropdown-menu {
	max-height: 300px;
	overflow: hidden;
	overflow-y: auto;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.12);
	border: 1px solid #eee;
	padding: 0;
}

.ebs-coin-select .dropdown-menu .ebs-coin-search-wrap {
	position: sticky;
	top: 0;
	background: #fff;
	padding: 8px 12px;
	z-index: 1;
}

.ebs-coin-select .dropdown-menu .ebs-coin-search-wrap:hover {
	background: #fff;
}

.ebs-coin-select .dropdown-menu .ebs-coin-search {
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 13px;
	outline: none;
}

.ebs-coin-select .dropdown-menu .ebs-coin-search:focus {
	border-color: #4a90d9;
}

.ebs-coin-select .dropdown-menu li {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px !important;
	padding: 10px 16px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.15s;
}

.ebs-coin-select .dropdown-menu li:hover {
	background: #f0f0f0;
}

.ebs-coin-select .dropdown-menu li .ebs-coin-bal-line {
	display: block;
	width: 100%;
	font-size: 11px;
	color: #888;
	padding-left: 26px;
	margin-top: 2px;
	line-height: 1.3;
}

.ebs-coin-select .dropdown-menu li img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

/* ── minimum hint ── */
.ebs-min-hint {
	font-size: 12px;
	color: #6c757d;
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 5px;
}

.ebs-min-hint i {
	font-size: 11px;
	color: #4a90d9;
}

[data-theme="dark"] .ebs-min-hint {
	color: #a0a0b0;
}

[data-theme="dark"] .ebs-min-hint i {
	color: #5b9bd5;
}

/* ── amount input ── */
.ebs-amount-input {
	text-align: right;
	font-size: 18px;
	font-weight: 600;
	color: #1a1a2e;
	background: transparent;
	border: none;
	outline: none;
	width: 140px;
	padding: 0;
}

.ebs-amount-input::placeholder {
	color: #ccc;
}

.ebs-amount-right {
	display: flex;
	align-items: center;
}

/* ── max button ── */
.ebs-max-btn {
	font-size: 12px;
	font-weight: 700;
	color: #4a90d9;
	background: #e8f0fe;
	border: 1px solid #4a90d9;
	border-radius: 6px;
	padding: 4px 10px;
	cursor: pointer;
	margin-left: 8px;
	white-space: nowrap;
	transition: opacity 0.15s;
}

.ebs-max-btn:hover {
	opacity: 0.8;
}

/* ── separator ── */
.ebs-separator {
	text-align: center;
	padding: 4px 0;
}

.ebs-separator i {
	font-size: 18px;
	color: #888;
}

/* ── receive amount (read-only display) ── */
.ebs-receive-amount {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a2e;
	text-align: right;
}

/* ── fee / timer footer ── */
.ebs-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0 16px;
	font-size: 13px;
	color: #888;
}

.ebs-fee {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ebs-timer {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #DCFAE6;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 13px;
	font-weight: 600;
	color: #666;
}

.ebs-timer.ebs-timer-expired {
	background: #FEE4E2;
}

.ebs-timer i {
	font-size: 14px;
}

/* ── submit buttons ── */
.ebs-submit-btn {
	width: 100%;
	padding: 14px;
	border-radius: 10px;
	border: none;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	transition: opacity 0.2s;
}

.ebs-submit-btn:hover {
	opacity: 0.9;
}

.ebs-submit-btn.ebs-buy {
	background: #226DB6;
}

.ebs-submit-btn.ebs-sell {
	background: #226DB6;
}

.ebs-submit-btn.ebs-refresh {
	background: #2563EB;
}

.ebs-submit-btn.ebs-disabled {
	background: #E8E9EA;
	color: #999;
	cursor: not-allowed;
}

/* ── inline feedback / warnings ── */
.ebs-feedback {
	font-size: 13px;
	padding: 8px 0;
	line-height: 1.4;
	display: none;
}

.ebs-feedback.ebs-warning {
	color: #e67e22;
	display: block;
}

.ebs-feedback.ebs-error {
	color: #dc3545;
	display: block;
}

/* ── info button ── */
.ebs-info-btn {
	position: absolute;
	right: 16px;
	bottom: 12px;
	color: #888;
	cursor: pointer;
	font-size: 16px;
}

.ebs-info-btn:hover {
	color: #555;
}

/* ── loading spinner ── */
.ebs-card .top-center {
	text-align: center;
}

/* ── success / error result cards ── */
.ebs-result {
	text-align: left;
	padding: 32px 16px;
}

.ebs-result h2 {
	display: block;
	text-align: center;
}

.ebs-result-actions {
	text-align: center;
}

.ebs-result-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px auto;
}

.ebs-result-icon.ebs-success {
	background: #d4edda;
	color: #28a745;
}

.ebs-result-icon.ebs-error {
	background: #f8d7da;
	color: #dc3545;
}

.ebs-result-icon i {
	font-size: 28px;
}

.ebs-result h2 {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #1a1a2e;
}

.ebs-result p {
	font-size: 14px;
	color: #888;
	margin-bottom: 24px;
	text-align: center;
}

.ebs-result-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 300px;
	margin: 0 auto;
}

.ebs-result-actions .btn {
	border-radius: 10px;
	padding: 12px;
	font-weight: 600;
}

/* ── bottom exchange link ── */
.ebs-exchange-link {
	text-align: center;
	margin: 16px 0 24px;
}

/* ── dark theme ── */
[data-theme="dark"] .ebs-card {
	background: #1e1e2f;
	box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .ebs-tabs {
	background: #2a2a3d;
}

[data-theme="dark"] .ebs-tab {
	color: #888;
}

[data-theme="dark"] .ebs-tab.active {
	background: #3a3a50;
	color: #e0e0e0;
}

[data-theme="dark"] .ebs-balance-amount {
	color: #e0e0e0;
}

[data-theme="dark"] .ebs-section {
	background: #2a2a3d;
}

[data-theme="dark"] .ebs-coin-name,
[data-theme="dark"] .ebs-amount-input,
[data-theme="dark"] .ebs-receive-amount,
[data-theme="dark"] .ebs-coin-select .custom-dropdown .btn {
	color: #e0e0e0 !important;
}

[data-theme="dark"] .ebs-amount-input::placeholder {
	color: #555;
}

[data-theme="dark"] .ebs-max-btn {
	color: #5b9bd5;
	background: #2a3a50;
	border-color: #5b9bd5;
}

[data-theme="dark"] .ebs-timer {
	background: #2a2a3d;
	color: #aaa;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu {
	background: #2a2a3d;
	border-color: #3a3a50;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu li:hover {
	background: #3a3a50;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu li {
	color: #e0e0e0;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu li .ebs-coin-bal-line {
	color: #a0a0b0;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu .ebs-coin-search-wrap {
	background: #2a2a3d;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu .ebs-coin-search-wrap:hover {
	background: #2a2a3d;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu .ebs-coin-search {
	background: #1e1e2e;
	border-color: #3a3a50;
	color: #e0e0e0;
}

[data-theme="dark"] .ebs-coin-select .dropdown-menu .ebs-coin-search:focus {
	border-color: #4a90d9;
}

[data-theme="dark"] .ebs-result h2 {
	color: #e0e0e0;
}

/* ── trade summary table (success popup) ── */
.ebs-trade-summary {
	width: 100%;
	margin: 20px 0;
	border-collapse: collapse;
}

.ebs-trade-summary td {
	padding: 12px 0;
	border-bottom: 1px solid #e9ecef;
	font-size: 14px;
	color: #6c757d;
}

.ebs-trade-summary td.text-right {
	text-align: right;
	font-weight: 600;
	color: #212529;
}

.ebs-trade-summary tr.ebs-trade-total td {
	border-bottom: none;
	font-weight: 700;
	font-size: 16px;
	color: #212529;
}

[data-theme="dark"] .ebs-trade-summary td {
	border-bottom-color: #3a3a50;
	color: #a0a0b0;
}

[data-theme="dark"] .ebs-trade-summary td.text-right {
	color: #e0e0e0;
}

[data-theme="dark"] .ebs-trade-summary tr.ebs-trade-total td {
	color: #e0e0e0;
}

/* ── confirmation card ── */
.ebs-result-icon.ebs-confirm-icon {
	background: #e8f0fe;
	color: #226DB6;
}

.ebs-confirm-timer-bar {
	width: 100%;
	height: 4px;
	background: #e9ecef;
	border-radius: 2px;
	margin: 20px 0 8px;
	overflow: hidden;
}

.ebs-confirm-timer-fill {
	height: 100%;
	background: #226DB6;
	border-radius: 2px;
	transition: width 1s linear;
}

.ebs-confirm-countdown {
	text-align: center;
	font-size: 13px;
	color: #888;
	margin-bottom: 16px;
}

.ebs-confirm-expired-msg {
	text-align: center;
	color: #dc3545;
	font-size: 14px;
	margin-bottom: 16px;
}

[data-theme="dark"] .ebs-result-icon.ebs-confirm-icon {
	background: #2a3a50;
	color: #5b9bd5;
}

[data-theme="dark"] .ebs-confirm-timer-bar {
	background: #3a3a50;
}

[data-theme="dark"] .ebs-confirm-timer-fill {
	background: #5b9bd5;
}

/* ── responsive ── */
@media (max-width: 576px) {
	.ebs-card {
		border-radius: 12px;
		padding: 16px;
	}

	.ebs-balance-amount {
		font-size: 24px;
	}

	.ebs-amount-input {
		width: 110px;
		font-size: 16px;
	}

	.ebs-coin-name {
		font-size: 16px;
	}

	.ebs-receive-amount {
		font-size: 16px;
	}

	.ebs-coin-select .custom-dropdown .btn {
		font-size: 16px;
	}
}
