/* Aqil Zikry Waktu Solat Malaysia — front-end styles
 *
 * Theming: .wsmy-card carries a theme class (wsmy-theme-emerald, wsmy-theme-light,
 * wsmy-theme-midnight). Every theme only swaps the CSS variables below, so the
 * layout rules are written once. Add a new theme = add one variable block.
 */

/* ---------- THEME: Emerald (default — dark green & gold) ---------- */
.wsmy-card,
.wsmy-card.wsmy-theme-emerald {
	--wsmy-bg: #0f2a24;
	--wsmy-bg-2: #16413a;
	--wsmy-accent: #c9a24b;
	--wsmy-accent-2: #b28a35;
	--wsmy-accent-soft: rgba(201, 162, 75, 0.16);
	--wsmy-accent-line: rgba(201, 162, 75, 0.35);
	--wsmy-on-accent: #23180a;
	--wsmy-on-accent-muted: rgba(35, 24, 10, 0.75);
	--wsmy-text: #eef4f1;
	--wsmy-muted: rgba(238, 244, 241, 0.62);
	--wsmy-line: rgba(255, 255, 255, 0.08);
	--wsmy-item-bg: rgba(255, 255, 255, 0.04);
	--wsmy-item-bg-hover: rgba(255, 255, 255, 0.07);
	--wsmy-shadow: 0 20px 45px -25px rgba(0, 0, 0, 0.6);
}

/* ---------- THEME: Light (white & green) ---------- */
.wsmy-card.wsmy-theme-light {
	--wsmy-bg: #ffffff;
	--wsmy-bg-2: #f4f8f6;
	--wsmy-accent: #0e7a5f;
	--wsmy-accent-2: #0a5c47;
	--wsmy-accent-soft: rgba(14, 122, 95, 0.08);
	--wsmy-accent-line: rgba(14, 122, 95, 0.3);
	--wsmy-on-accent: #ffffff;
	--wsmy-on-accent-muted: rgba(255, 255, 255, 0.8);
	--wsmy-text: #1c2b26;
	--wsmy-muted: rgba(28, 43, 38, 0.55);
	--wsmy-line: rgba(28, 43, 38, 0.1);
	--wsmy-item-bg: rgba(14, 122, 95, 0.05);
	--wsmy-item-bg-hover: rgba(14, 122, 95, 0.1);
	--wsmy-shadow: 0 18px 40px -28px rgba(28, 43, 38, 0.35);
}

/* ---------- THEME: Midnight (deep navy & sky) ---------- */
.wsmy-card.wsmy-theme-midnight {
	--wsmy-bg: #0c1226;
	--wsmy-bg-2: #17224a;
	--wsmy-accent: #7fb4ff;
	--wsmy-accent-2: #5a92e6;
	--wsmy-accent-soft: rgba(127, 180, 255, 0.12);
	--wsmy-accent-line: rgba(127, 180, 255, 0.35);
	--wsmy-on-accent: #0a1020;
	--wsmy-on-accent-muted: rgba(10, 16, 32, 0.72);
	--wsmy-text: #e9effb;
	--wsmy-muted: rgba(233, 239, 251, 0.6);
	--wsmy-line: rgba(255, 255, 255, 0.08);
	--wsmy-item-bg: rgba(255, 255, 255, 0.05);
	--wsmy-item-bg-hover: rgba(255, 255, 255, 0.09);
	--wsmy-shadow: 0 20px 45px -25px rgba(0, 0, 0, 0.7);
}

/* ---------- layout (theme-agnostic) ---------- */
.wsmy-card {
	--wsmy-radius: 18px;

	max-width: 720px;
	margin: 1.5rem auto;
	padding: 1.4rem 1.5rem 1.1rem;
	color: var(--wsmy-text);
	background: radial-gradient(120% 140% at 100% 0%, var(--wsmy-bg-2) 0%, var(--wsmy-bg) 55%);
	border: 1px solid var(--wsmy-line);
	border-radius: var(--wsmy-radius);
	box-shadow: var(--wsmy-shadow);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	line-height: 1.35;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.wsmy-card *,
.wsmy-card *::before,
.wsmy-card *::after {
	box-sizing: inherit;
}

/* subtle top accent hairline */
.wsmy-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--wsmy-accent), transparent);
	opacity: 0.7;
}

/* ---------- header ---------- */
.wsmy-head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	align-items: flex-start;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--wsmy-line);
}

.wsmy-head-main {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.wsmy-title {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.wsmy-zone {
	font-size: 0.78rem;
	color: var(--wsmy-muted);
	max-width: 42ch;
}

.wsmy-head-date {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	gap: 0.15rem;
}

.wsmy-greg {
	font-size: 0.85rem;
	font-weight: 600;
}

.wsmy-hijri {
	font-size: 0.78rem;
	color: var(--wsmy-accent);
	font-weight: 600;
}

.wsmy-card.wsmy-theme-light .wsmy-hijri {
	color: var(--wsmy-accent-2);
}

/* ---------- next-prayer countdown ---------- */
.wsmy-next {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 0.9rem;
	margin-top: 1rem;
	padding: 0.7rem 0.95rem;
	background: var(--wsmy-accent-soft);
	border: 1px solid var(--wsmy-accent-line);
	border-radius: 12px;
}

.wsmy-next-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wsmy-muted);
}

.wsmy-next-name {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wsmy-accent);
}

.wsmy-card.wsmy-theme-light .wsmy-next-name {
	color: var(--wsmy-accent-2);
}

.wsmy-next-count {
	margin-left: auto;
	font-variant-numeric: tabular-nums;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

/* ---------- prayer grid ---------- */
.wsmy-grid {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 0.55rem;
}

.wsmy-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 0.85rem 0.5rem;
	border-radius: 12px;
	background: var(--wsmy-item-bg);
	border: 1px solid transparent;
	transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
	margin: 0;
}

.wsmy-item:hover {
	transform: translateY(-2px);
	background: var(--wsmy-item-bg-hover);
}

.wsmy-name {
	font-size: 0.78rem;
	color: var(--wsmy-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wsmy-time {
	font-size: 1.2rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* current prayer highlight (added by JS) */
.wsmy-item.is-active {
	background: linear-gradient(160deg, var(--wsmy-accent), var(--wsmy-accent-2));
	border-color: rgba(255, 255, 255, 0.25);
	box-shadow: 0 10px 25px -12px var(--wsmy-accent);
}

.wsmy-item.is-active .wsmy-name {
	color: var(--wsmy-on-accent-muted);
}

.wsmy-item.is-active .wsmy-time {
	color: var(--wsmy-on-accent);
}

/* ---------- footer ---------- */
.wsmy-foot {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 1rem;
	padding-top: 0.8rem;
	border-top: 1px solid var(--wsmy-line);
	font-size: 0.72rem;
	color: var(--wsmy-muted);
}

/* ---------- compact layout variant ---------- */
.wsmy-card.wsmy-layout-compact {
	max-width: 420px;
	padding: 1.1rem 1.2rem 0.9rem;
}

.wsmy-card.wsmy-layout-compact .wsmy-grid {
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 0.4rem;
}

.wsmy-card.wsmy-layout-compact .wsmy-item {
	padding: 0.6rem 0.4rem;
}

.wsmy-card.wsmy-layout-compact .wsmy-time {
	font-size: 1.02rem;
}

.wsmy-card.wsmy-layout-compact .wsmy-title {
	font-size: 1.05rem;
}

/* ---------- error state ---------- */
.wsmy-error {
	background: #3a1f1f;
	border-color: rgba(255, 120, 120, 0.4);
	text-align: center;
	color: #ffdede;
}

.wsmy-error p {
	margin: 0.5rem 0;
}

/* ---------- responsive ---------- */
@media (max-width: 420px) {
	.wsmy-card { padding: 1.1rem; }
	.wsmy-head-date { align-items: flex-start; text-align: left; }
	.wsmy-time { font-size: 1.05rem; }
}
