/**
 * Vedic Birth Chart — base styles.
 * Scoped under .vbc-app so the plugin never leaks styles onto the rest of
 * the theme, and never overrides theme-level element selectors.
 *
 * Palette/typography matches the Astrocrony brand: deep violet "cosmic"
 * background, gold accents, glass panels — Cinzel for display headings,
 * Cormorant Garamond for serif body copy, Outfit for UI text.
 */

.vbc-app {
	--vbc-bg: #1b1148;
	--vbc-bg-2: #2a1c6b;
	--vbc-primary: #6e3ff3;
	--vbc-primary-dark: #c6a8ff;
	--vbc-accent: #f4c542;
	--vbc-accent-soft: #fbe6a2;
	--vbc-ink: #f3eeff;
	--vbc-muted: #c6a8ff;
	--vbc-muted-2: rgba(220, 199, 255, 0.75);
	--vbc-border: rgba(198, 168, 255, 0.3);
	--vbc-surface: rgba(21, 13, 58, 0.55);
	--vbc-surface-alt: rgba(158, 110, 255, 0.14);
	--vbc-error: #ff8a8a;
	--vbc-error-bg: rgba(255, 90, 90, 0.14);
	--vbc-success: #7be0a8;
	--vbc-radius: 16px;
	--vbc-shadow: 0 14px 40px -20px rgba(0, 0, 0, 0.85);
	--vbc-font-display: "Cinzel", "Georgia", serif;
	--vbc-font-serif: "Cormorant Garamond", Georgia, serif;
	--vbc-font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--vbc-font);
	color: var(--vbc-ink);
	max-width: 960px;
	margin: 0 auto;
	box-sizing: border-box;
}

.vbc-app *,
.vbc-app *::before,
.vbc-app *::after {
	box-sizing: inherit;
}

.vbc-card {
	position: relative;
	background:
		linear-gradient(160deg, rgba(158, 110, 255, 0.16), rgba(30, 20, 80, 0.5)) padding-box,
		linear-gradient(140deg, rgba(220, 199, 255, 0.5), rgba(158, 110, 255, 0.3) 55%, rgba(244, 197, 66, 0.4)) border-box;
	border: 1px solid transparent;
	border-radius: var(--vbc-radius);
	box-shadow: var(--vbc-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	padding: 32px;
	margin-bottom: 24px;
}

.vbc-card__title {
	font-family: var(--vbc-font-display);
	letter-spacing: 0.02em;
	margin: 0 0 6px;
	font-size: 1.6em;
	color: var(--vbc-accent-soft);
	text-shadow: 0 0 24px rgba(244, 197, 66, 0.28);
}

.vbc-card__subtitle {
	margin: 0 0 28px;
	color: var(--vbc-muted-2);
}

.vbc-form {
	display: grid;
	gap: 22px;
}

.vbc-field {
	display: grid;
	gap: 6px;
}

.vbc-field > label,
.vbc-field > legend {
	font-weight: 600;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(198, 168, 255, 0.85);
	padding: 0;
}

.vbc-field input[type="text"],
.vbc-field select {
	font: inherit;
	font-size: 0.95rem;
	padding: 0.8rem 1rem;
	border: 1px solid var(--vbc-border);
	border-radius: 12px;
	background: rgba(21, 13, 58, 0.6);
	color: var(--vbc-ink);
	width: 100%;
}

.vbc-field select option {
	background: var(--vbc-bg);
	color: var(--vbc-ink);
}

.vbc-field input[type="text"]:focus-visible,
.vbc-field select:focus-visible,
.vbc-field input[type="text"]:focus,
.vbc-field select:focus {
	outline: none;
	border-color: var(--vbc-accent);
	box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.15);
}

.vbc-button:focus-visible {
	outline: 2px solid var(--vbc-accent);
	outline-offset: 3px;
}

.vbc-field--group {
	border: none;
	margin: 0;
	padding: 0;
}

.vbc-date-group,
.vbc-time-group {
	display: flex;
	gap: 10px;
	align-items: center;
}

.vbc-date-part {
	flex: 1 1 0;
	min-width: 0;
}

.vbc-time-group .vbc-date-part {
	flex: 0 0 90px;
}

.vbc-time-sep {
	font-weight: 700;
	color: var(--vbc-muted);
}

.vbc-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.vbc-field__hint {
	margin: 0;
	font-size: 0.85em;
	color: var(--vbc-muted-2);
}

.vbc-field__error,
.vbc-form__error {
	margin: 0;
	font-size: 0.88em;
	color: var(--vbc-error);
	background: var(--vbc-error-bg);
	border-radius: 6px;
	padding: 8px 10px;
}

.vbc-combobox {
	position: relative;
}

.vbc-combobox__listbox {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: linear-gradient(180deg, rgba(48, 30, 104, 0.98), rgba(27, 17, 72, 0.98));
	border: 1px solid var(--vbc-border);
	border-radius: 12px;
	box-shadow: var(--vbc-shadow);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	max-height: 260px;
	overflow-y: auto;
}

.vbc-combobox__option {
	padding: 9px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.95em;
	color: var(--vbc-ink);
}

.vbc-combobox__option[aria-selected="true"],
.vbc-combobox__option:hover {
	background: rgba(244, 197, 66, 0.12);
	color: var(--vbc-accent);
}

.vbc-combobox__status {
	margin: 4px 0 0;
	font-size: 0.82em;
	color: var(--vbc-muted-2);
	min-height: 1.2em;
}

.vbc-form__actions {
	display: flex;
	justify-content: center;
	margin-top: 6px;
}

.vbc-button {
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.02em;
	font-size: 1.02em;
	padding: 0.95rem 1.8rem;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.vbc-button--primary {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, var(--vbc-accent-soft), var(--vbc-accent));
	color: #2a1e00;
	box-shadow: 0 8px 30px rgba(244, 197, 66, 0.3);
}

.vbc-button--primary:hover:not(:disabled) {
	transform: translateY(-3px);
	box-shadow: 0 0 44px rgba(244, 197, 66, 0.6);
}

.vbc-button:disabled {
	opacity: 0.7;
	cursor: progress;
}

.vbc-spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(42, 30, 0, 0.35);
	border-top-color: #2a1e00;
	animation: vbc-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.vbc-spinner {
		animation-duration: 1.6s;
	}
}

@keyframes vbc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------------------------------------------------------------- */
/* Result section                                                          */
/* ---------------------------------------------------------------------- */

.vbc-result-card h2,
.vbc-result-card h3,
.vbc-result-card h4 {
	font-family: var(--vbc-font-display);
	letter-spacing: 0.02em;
	color: var(--vbc-accent-soft);
	text-shadow: 0 0 22px rgba(244, 197, 66, 0.22);
}

.vbc-summary-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px 24px;
	list-style: none;
	margin: 0 0 28px;
	padding: 18px 20px;
	background: var(--vbc-surface-alt);
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
}

.vbc-summary-list dt {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--vbc-muted);
	margin: 0;
}

.vbc-summary-list dd {
	margin: 2px 0 0;
	font-weight: 600;
	color: var(--vbc-ink);
}

.vbc-charts-row {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	justify-content: center;
	margin: 24px 0;
}

.vbc-chart-block {
	text-align: center;
}

.vbc-chart-block h3,
.vbc-chart-block h4 {
	margin-bottom: 10px;
}

.vbc-result-card h4 {
	margin: 24px 0 10px;
	font-size: 1.05em;
}

.vbc-chart-svg-wrap {
	display: inline-block;
	max-width: 100%;
	padding: 14px;
	border-radius: var(--vbc-radius);
	background: radial-gradient(125% 135% at 50% 0%, rgba(96, 55, 220, 0.35), rgba(18, 10, 52, 0.6));
	border: 1px solid var(--vbc-border);
}

.vbc-chart-svg-wrap svg {
	max-width: 100%;
	height: auto;
	display: block;
}

.vbc-details-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 14px 24px;
	margin: 0 0 28px;
	list-style: none;
	padding: 0;
}

.vbc-details-grid dt {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--vbc-muted);
	margin: 0;
}

.vbc-details-grid dd {
	margin: 2px 0 0;
	font-weight: 600;
	color: var(--vbc-ink);
}

.vbc-table-wrap {
	overflow-x: auto;
	margin: 0 0 28px;
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
}

table.vbc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
	min-width: 640px;
}

table.vbc-table caption {
	text-align: left;
	font-weight: 700;
	padding: 12px 14px 0;
	color: var(--vbc-accent-soft);
}

/*
 * Explicit background + color on every cell, in both thead and tbody.
 * Without this, a host theme's own generic `th { ... }` rule (many themes
 * style ALL <th> elements with a dark "header" background) leaks into our
 * <th scope="row"> row headers here, since we'd otherwise only be
 * overriding thead th and leaving tbody th unstyled and illegible.
 */
table.vbc-table th,
table.vbc-table td {
	text-align: left;
	padding: 10px 14px;
	border-bottom: 1px solid var(--vbc-border);
	white-space: nowrap;
	background-color: transparent;
	color: var(--vbc-ink);
	font-weight: 400;
}

table.vbc-table tbody th {
	font-weight: 700;
	color: var(--vbc-accent-soft);
}

table.vbc-table thead th {
	background-color: rgba(158, 110, 255, 0.14);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--vbc-muted);
	font-weight: 700;
}

table.vbc-table tbody tr:last-child td,
table.vbc-table tbody tr:last-child th {
	border-bottom: none;
}

.vbc-table-wrap--scroll-y {
	max-height: 320px;
	overflow-y: auto;
}

tr.vbc-dasha-row--current th,
tr.vbc-dasha-row--current td {
	background: rgba(244, 197, 66, 0.14);
	font-weight: 700;
	color: var(--vbc-accent-soft);
}

.vbc-retro-yes {
	color: var(--vbc-error);
	font-weight: 700;
}

.vbc-dasha-current {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.vbc-dasha-current__item {
	background: var(--vbc-surface-alt);
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
	padding: 14px 20px;
	flex: 1 1 200px;
}

.vbc-dasha-current__item .label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--vbc-muted);
	display: block;
	margin-bottom: 4px;
}

.vbc-dasha-current__item .value {
	font-size: 1.15em;
	font-weight: 700;
	color: var(--vbc-accent-soft);
}

.vbc-actions-row {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	margin-bottom: 18px;
}

.vbc-button--ghost {
	background: rgba(110, 63, 243, 0.08);
	border: 1px solid rgba(185, 139, 255, 0.5);
	color: #e9e6fb;
	padding: 8px 18px;
	font-size: 0.9em;
}

.vbc-button--ghost:hover {
	border-color: var(--vbc-accent);
	color: var(--vbc-accent);
	background: rgba(244, 197, 66, 0.1);
	transform: translateY(-2px);
}

.vbc-precision-note {
	font-family: var(--vbc-font-serif);
	font-size: 0.95em;
	font-style: italic;
	color: var(--vbc-muted-2);
	border-top: 1px solid var(--vbc-border);
	padding-top: 14px;
	margin-top: 8px;
}

/* ---------------------------------------------------------------------- */
/* Dasha accordion                                                          */
/* ---------------------------------------------------------------------- */

.vbc-dasha-md-list {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
	overflow: hidden;
}

.vbc-dasha-md-list li + li {
	border-top: 1px solid var(--vbc-border);
}

.vbc-dasha-md__toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: transparent;
	border: none;
	color: var(--vbc-ink);
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.vbc-dasha-md__toggle:hover,
.vbc-dasha-md__toggle[aria-expanded="true"] {
	background: rgba(244, 197, 66, 0.08);
	color: var(--vbc-accent-soft);
}

.vbc-dasha-md__toggle.is-current {
	color: var(--vbc-accent);
}

.vbc-dasha-md__dates {
	font-weight: 400;
	color: var(--vbc-muted-2);
	font-size: 0.85em;
	margin-left: auto;
	margin-right: 12px;
}

.vbc-dasha-md__chevron {
	transition: transform 0.25s ease;
	flex: none;
}

.vbc-dasha-md__toggle[aria-expanded="true"] .vbc-dasha-md__chevron {
	transform: rotate(180deg);
}

.vbc-dasha-md__panel {
	padding: 0 18px 16px;
}

.vbc-dasha-md__panel[hidden] {
	display: none;
}

/* ---------------------------------------------------------------------- */
/* Shad Bala bar chart                                                     */
/* ---------------------------------------------------------------------- */

.vbc-shadbala {
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
	overflow: hidden;
	margin: 0 0 28px;
}

.vbc-shadbala__bars {
	display: flex;
	align-items: stretch;
	height: 220px;
	background: linear-gradient(to bottom, rgba(123, 224, 168, 0.35) 0%, rgba(123, 224, 168, 0.35) 55%, rgba(255, 138, 138, 0.28) 55%, rgba(255, 138, 138, 0.28) 100%);
}

.vbc-shadbala__col {
	flex: 1 1 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0 4px;
}

.vbc-shadbala__bar {
	width: 100%;
	max-width: 64px;
	background: linear-gradient(180deg, rgba(251, 230, 162, 0.95), rgba(244, 197, 66, 0.85));
	border: 1px solid rgba(42, 30, 0, 0.25);
	border-radius: 4px 4px 0 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 6px;
	box-shadow: 0 -4px 14px -4px rgba(244, 197, 66, 0.5);
}

.vbc-shadbala__value {
	font-weight: 700;
	font-size: 0.85em;
	color: #2a1e00;
}

.vbc-shadbala__labels {
	display: flex;
	background: rgba(21, 13, 58, 0.6);
}

.vbc-shadbala__label {
	flex: 1 1 0;
	text-align: center;
	padding: 10px 4px;
	font-family: var(--vbc-font-display);
	font-weight: 700;
	font-size: 0.95em;
}

.vbc-shadbala-detail {
	border: 1px solid var(--vbc-border);
	border-radius: var(--vbc-radius);
	padding: 14px 18px;
	margin: 0 0 28px;
}

.vbc-shadbala-detail summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--vbc-accent-soft);
}

.vbc-shadbala-detail .vbc-table-wrap {
	margin-top: 14px;
}

.vbc-shadbala-detail p {
	margin: 10px 0 0;
}

.vbc-shadbala__note {
	padding: 10px 16px;
	font-size: 0.8em;
	color: var(--vbc-muted-2);
	background: rgba(21, 13, 58, 0.4);
	border-top: 1px solid var(--vbc-border);
}
