/* ============================================================
   ETF Creation Unit Widget – etf-creation-unit.css
   ============================================================ */

/* Wrapper */
.etf-cu-widget {
	font-family: inherit;
	color: #222;
	max-width: 960px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Heading */
.etf-cu-heading {
	text-align: center;
	font-size: 1.65rem;
	font-weight: 700;
	margin-bottom: 8px;
	color: #1a1a2e;
}

.etf-cu-heading-divider {
	width: 48px;
	height: 3px;
	background: #6b7280;
	border: none;
	border-radius: 2px;
	margin: 0 auto 32px;
}

/* Controls card */
.etf-cu-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-end;
	justify-content: center;
	margin: 0 auto 32px;
	max-width: 640px;
	background: #fff;
	border: 1.5px solid #d1dbe8;
	border-radius: 12px;
	padding: 28px 32px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.etf-cu-control-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 200px;
	flex: 1;
}

.etf-cu-label {
	font-size: 0.8rem;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Select / date input share the same look */
.etf-cu-select {
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	padding: 11px 36px 11px 14px;
	font-size: 0.95rem;
	color: #222;
	background: #fff;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	width: 100%;
	box-sizing: border-box;
}

.etf-cu-select:focus {
	border-color: #0077C8;
	box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.1);
}

/* Date input wrapper */
.etf-cu-date-wrapper {
	position: relative;
}

.etf-cu-date-wrapper::after {
	content: '';
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230077C8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	pointer-events: none;
}

/* Export button */
.etf-cu-export-group {
	flex: 0 0 auto !important;
	min-width: auto !important;
	align-self: flex-end;
}

.etf-cu-export-btn {
	background: linear-gradient(135deg, #0077C8 0%, #005fa3 100%);
	color: #fff !important;
	border: none;
	border-radius: 28px;
	padding: 12px 32px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
	box-shadow: 0 4px 14px rgba(0, 119, 200, 0.35);
	white-space: nowrap;
}

.etf-cu-export-btn:hover {
	background: linear-gradient(135deg, #005fa3 0%, #004a80 100%);
	box-shadow: 0 6px 20px rgba(0, 119, 200, 0.45);
	transform: translateY(-1px);
}

/* Result section */
.etf-cu-result {
	animation: etfCUFadeIn 0.25s ease;
}

@keyframes etfCUFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Tables */
.etf-cu-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 12px;
	font-size: 0.9rem;
	border-radius: 8px;
	overflow: hidden;
}

.etf-cu-securities-table thead tr {
	background: #e8f0fe;
}

.etf-cu-table th,
.etf-cu-table td {
	border: 1px solid #e8ecf1;
	padding: 11px 16px;
	text-align: left;
}

.etf-cu-table th {
	font-weight: 600;
	color: #2d3748;
	white-space: nowrap;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.etf-cu-table tbody tr:nth-child(odd) {
	background: #fafbff;
}

.etf-cu-table tbody tr:hover {
	background: #eef3fb;
}

/* Summary table */
.etf-cu-summary-table {
	margin-top: 8px;
}

.etf-cu-summary-table td:first-child {
	font-weight: 500;
	color: #444;
	width: 60%;
}

.etf-cu-summary-table td:last-child {
	text-align: right;
	font-weight: 600;
	color: #1a1a2e;
}

/* Message / loading */
.etf-cu-message {
	text-align: center;
	padding: 24px;
	color: #555;
	font-size: 0.95rem;
}

.etf-cu-message.is-error {
	color: #c0392b;
}

/* Flatpickr – theme overrides to match the Bajaj Downloads blue design */
.etf-cu-widget .flatpickr-input.active,
.etf-cu-widget .flatpickr-input.active + .form-control {
	border-color: #0077C8;
	box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.1);
}

/* The altInput created by flatpickr inherits the base input style */
.etf-cu-widget .flatpickr-alt-input,
.etf-cu-widget input.flatpickr-input {
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	padding: 11px 36px 11px 14px;
	font-size: 0.95rem;
	color: #222;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
	cursor: pointer;
}

.etf-cu-widget input.flatpickr-input:focus {
	border-color: #0077C8;
	box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.1);
	outline: none;
}

/* Calendar container */
.flatpickr-calendar {
	border-radius: 8px !important;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
	border: 1px solid #e0e0e0 !important;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Month header bar */
.flatpickr-months {
	background: #0077C8;
	border-radius: 8px 8px 0 0;
	padding: 4px 0;
}

.flatpickr-months .flatpickr-month {
	background: transparent;
	color: #fff;
	fill: #fff;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
	background: #0077C8;
	color: #fff !important;
	font-weight: 600;
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
	background: #fff;
	color: #333;
}

.flatpickr-current-month input.cur-year {
	color: #fff !important;
	font-weight: 700;
}

/* ── Hide the default year numeric input (replaced by .etf-cu-year-select) ── */
.flatpickr-current-month .numInputWrapper {
	display: none !important;
}

/* ── Year dropdown select ── */
.flatpickr-current-month .etf-cu-year-select {
	display: inline-block !important;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23fff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 6px center;
	background-size: 8px 5px;
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	border: 0 none;
	border-radius: 4px;
	padding: 2px 22px 2px 8px;
	cursor: pointer;
	outline: none;
	height: 28px;
	line-height: 24px;
	transition: background-color 0.2s;
}

.flatpickr-current-month .etf-cu-year-select:hover {
	background-color: rgba(255, 255, 255, 0.25);
}

.flatpickr-current-month .etf-cu-year-select:focus {
	border-color: rgba(255, 255, 255, 0.6);
}

.flatpickr-current-month .etf-cu-year-select option {
	color: #333;
	background: #fff;
}

/* Ensure the month + year sit side by side */
.flatpickr-current-month {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 4px !important;
	padding: 0 !important;
	width: 100% !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
	fill: #fff !important;
	color: #fff !important;
	padding: 8px;
	transition: opacity 0.2s;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
	fill: #fff !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
	opacity: 0.75;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
	fill: #fff !important;
}

/* Weekday row */
span.flatpickr-weekday {
	color: #0077C8;
	font-weight: 600;
	font-size: 0.8rem;
}

/* Day cells */
.flatpickr-day {
	border-radius: 50%;
	max-width: 36px;
	height: 36px;
	line-height: 36px;
	margin: 2px;
	transition: background 0.15s, color 0.15s;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
	background: #e6f2fa;
	border-color: #e6f2fa;
}

.flatpickr-day.today {
	border-color: #0077C8;
}

.flatpickr-day.today:hover {
	background: #0077C8;
	border-color: #0077C8;
	color: #fff;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
	background: #0077C8;
	border-color: #0077C8;
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 119, 200, 0.35);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
	color: #bbb;
}

/* ── Flatpickr "Today" & "Clear" action bar ── */
.etf-cu-flatpickr-actions {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-top: 1px solid #e0e0e0;
	background: #f9f9f9;
	border-radius: 0 0 8px 8px;
}

.etf-cu-fp-btn {
	flex: 1;
	padding: 8px 0;
	font-size: 14px;
	font-weight: 600;
	border: none;
	border-radius: 20px;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s, color 0.15s;
	line-height: 1.4;
	color: #fff;
}

.etf-cu-fp-btn-today {
	background: #0077C8;
	color: #fff;
}

.etf-cu-fp-btn-today:hover {
	background: #005fa3;
}

.etf-cu-fp-btn-clear {
	background: #0077C8;
	color: #fff;
}

.etf-cu-fp-btn-clear:hover {
	background: #005fa3;
}

/* Tables wrapper */
.etf-cu-table-wrap {
	max-width: 800px;
	margin: 0 auto;
}

/* Responsive */
@media (max-width: 600px) {
	.etf-cu-controls {
		flex-direction: column;
		padding: 20px 18px;
	}

	.etf-cu-control-group {
		min-width: unset;
		width: 100%;
	}

	.etf-cu-export-group {
		width: 100% !important;
		align-self: center !important;
	}

	.etf-cu-export-btn {
		width: 100%;
	}

	.etf-cu-table {
		font-size: 0.8rem;
	}

	.etf-cu-table th,
	.etf-cu-table td {
		padding: 7px 8px;
	}
}
