/* ==========================================================================
   Malayalam online Panchangam (Panchangam.htm)
   Builds on home.css: <main class="home panch">.
   The calculator form keeps its original field names and order, because the
   panchangam script reads them through document.forms[0].
   ========================================================================== */

.panch {
  --font-head: 'Poppins', 'Noto Sans Malayalam', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Roboto', 'Noto Sans Malayalam', 'Segoe UI', system-ui, sans-serif;
  --pc-amber: #b45309;
  --pc-amber-soft: #fff7e6;
  --pc-green: #15803d;
  --pc-green-soft: #ecfdf3;
  --pc-red: #b91c1c;
  --pc-red-soft: #fef2f2;
}

/* ---------- calculator layout ---------- */
.pc-tool {
  padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(3.5rem, 7vw, 5rem);
}

/* one column: the header card (which is also the form), then the results */
.pc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

/* ---------- header card: title and the date, time and time zone fields ---------- */
/* Field edges come from custom properties so the generated dark theme (tools/build-dark-css.js)
   leaves them light: the card is the same gradient in both themes. */
.pc-head {
  --pc-edge: rgba(255, 255, 255, 0.3);
  --pc-edge-focus: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.6rem 1.75rem;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: linear-gradient(120deg, #5a67d8 0%, #764ba2 60%, #b2477f 100%);
  border-radius: 24px;
  box-shadow: 0 26px 50px -30px rgba(118, 75, 162, 0.9);
}

.pc-head::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -60px;
  z-index: -1;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.pc-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pc-head-title {
  min-width: 0;
}

/* the page's h1, styled as a small label above the date (beats the h1 rules of styles.css and home.css) */
.home .pc-res-kicker {
  display: block;
  margin: 0 0 0.3rem !important;
  font-family: var(--font-head) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  color: #fff !important;
  opacity: 0.85;
}

.home .pc-res-date {
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  color: #fff !important;
}

.pc-now {
  flex: none;
}

.pc-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--pc-edge);
}

.pc-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pc-group--date {
  flex: 1 1 18rem;
  max-width: 24rem;
}

.pc-group-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.pc-group-label small {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.pc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pc-row--date {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 76px;
}

.pc-colon {
  font-family: var(--font-head);
  font-weight: 700;
  opacity: 0.75;
}

.pc-head select,
.pc-head input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--pc-edge);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pc-head input[type="text"] {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pc-row:not(.pc-row--date) input[type="text"] {
  width: 4.5rem;
}

.pc-head .pc-ampm {
  flex: none;
  width: 5.75rem;
  margin-left: 0.25rem;
}

.pc-head select {
  padding-right: 1.75rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M1.6 5.1a1 1 0 0 1 1.4 0L8 10.1l5-5a1 1 0 1 1 1.4 1.4l-5.7 5.7a1 1 0 0 1-1.4 0L1.6 6.5a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  cursor: pointer;
}

/* the open list is drawn by the browser on its own background, so give its options dark text */
.pc-head select option {
  color: #1e293b;
  background: #fff;
}

.pc-head select:hover,
.pc-head input[type="text"]:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.pc-head select:focus,
.pc-head input[type="text"]:focus {
  background-color: rgba(255, 255, 255, 0.24);
  border-color: var(--pc-edge-focus);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
  outline: none;
}

.pc-hint {
  display: flex;
  gap: 0.4rem;
  margin-top: -0.4rem;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.8;
}

/* on the gradient in both themes: white text on a deep red tint */
.pc-error {
  --pc-error-edge: rgba(254, 202, 202, 0.55);
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: #fff;
  background: rgba(127, 29, 29, 0.55);
  border: 1px solid var(--pc-error-edge);
  border-radius: 12px;
}

/* ---------- results ---------- */
.pc-results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 24rem;
}

/* an entry is wrong: the results shown are still those of the last valid one */
.pc-results.pc-stale {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.pc-waiting {
  display: grid;
  place-items: center;
  min-height: 24rem;
  color: var(--muted);
  background: #fff;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 24px;
}

/* the blessing line above the header card; some languages have none */
.pc-invocation {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #6d28d9;
  text-align: center;
}

.pc-invocation:empty {
  display: none;
}

.pc-label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.pc-label small {
  margin-left: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* the five angas */
.pc-angas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.pc-anga {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.pc-anga--day {
  grid-column: 1 / -1;
  align-items: center;
}

.pc-num {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  background: #eef0ff;
  border-radius: 11px;
}

.pc-anga-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.pc-value {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.pc-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  margin-top: 0.3rem;
  font-size: 0.84rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pc-range .bi {
  font-size: 0.8rem;
  color: var(--muted);
}

.pc-range .bi-arrow-right {
  color: var(--accent);
}

/* sphutam / ayanamsa */
.pc-pos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.pc-stat {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.pc-stat-ico {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.pc-stat--moon .pc-stat-ico { color: #4f46e5; background: #eef0ff; }
.pc-stat--sun .pc-stat-ico { color: #d97706; background: #fef3c7; }
.pc-stat--ayan .pc-stat-ico { color: #0e8fa3; background: #e3f6f8; }

.pc-stat strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pc-stat-sign {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
}

/* boxes: kalam timings, chandrabalam, deeds */
.pc-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.pc-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.pc-box-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pc-box-head .bi {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  border-radius: 11px;
}

.home .pc-box h3 {
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.pc-box h3 small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pc-box--times .pc-box-head .bi {
  color: var(--pc-amber);
  background: var(--pc-amber-soft);
}

.pc-box--cb .pc-box-head .bi {
  color: #4f46e5;
  background: #eef0ff;
}

.pc-times {
  display: grid;
  gap: 0.55rem;
}

.pc-times li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.8rem;
  background: var(--pc-amber-soft);
  border-radius: 12px;
}

.pc-times strong {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pc-cb {
  display: grid;
  gap: 0.55rem;
}

.pc-cb li {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.92rem;
  line-height: 1.6;
  border-radius: 12px;
}

.pc-cb li .bi {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.pc-cb-good {
  color: #14532d;
  background: var(--pc-green-soft);
}

.pc-cb-good .bi {
  color: var(--pc-green);
}

.pc-cb-bad {
  color: #7f1d1d;
  background: var(--pc-red-soft);
}

.pc-cb-bad .bi {
  color: var(--pc-red);
}

.home .pc-deeds-title {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}

.pc-deeds-sub {
  margin-top: -0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.pc-deed {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.pc-deed-name {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--accent);
}

.pc-deed-body {
  display: grid;
  gap: 0.6rem;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
}

.pc-pred-lead {
  color: var(--ink);
}

.home .pc-pred-head {
  margin-top: 0.2rem;
  font-weight: 700;
  color: var(--accent);
}

.home .pc-pred-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.2rem;
  list-style: disc;
}

.pc-pred-list li::marker {
  color: var(--accent);
}

.pc-pred-list strong {
  color: var(--ink);
}

.pc-note {
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
  background: var(--soft);
  border-radius: 16px;
}

.pc-note a,
.pc-note a:visited {
  color: var(--accent);
  text-decoration: none;
}

.pc-note a:hover {
  text-decoration: underline;
}

/* ---------- online platform promo ---------- */
.pc-promo-section {
  padding: 0 0 clamp(3.5rem, 7vw, 5rem);
}

.pc-promo,
.pc-promo:visited {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 4vw, 2.75rem);
  overflow: hidden;
  isolation: isolate;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  background: linear-gradient(120deg, #c2417a 0%, #764ba2 55%, #5a67d8 100%);
  border-radius: 28px;
  box-shadow: 0 36px 70px -40px rgba(118, 75, 162, 0.9);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.pc-promo:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 40px 80px -40px rgba(118, 75, 162, 1);
}

.pc-promo::before {
  content: "";
  position: absolute;
  top: -180px;
  left: -80px;
  z-index: -1;
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.pc-promo img {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
  animation: h-bob 6s ease-in-out infinite;
}

.pc-promo-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pc-promo strong {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.pc-promo-badge {
  align-self: flex-start;
  padding: 0.2rem 0.65rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c2d12;
  background: #fde68a;
  border-radius: 999px;
}

.pc-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem !important;
}

.pc-langs li {
  padding: 0.22rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.pc-promo .h-btn {
  pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
  .pc-promo {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pc-promo .h-btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 767.98px) {
  .pc-angas,
  .pc-pos,
  .pc-split {
    grid-template-columns: 1fr;
  }

  .pc-deed {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .pc-head {
    padding: 1.3rem 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .pc-group--date {
    flex-basis: 100%;
    max-width: none;
  }

  .pc-promo {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .pc-promo img {
    width: 60px;
    height: 60px;
  }
}

/* ---------- languages (js/panchang-i18n.js) ---------- */
/* the small English names repeat the label when the page itself is in English */
.panch[data-pc-lang="en"] .pc-en {
  display: none;
}

/* Urdu reads right to left */
.panch[dir="rtl"] .pc-label small,
.panch[dir="rtl"] .pc-head .pc-ampm {
  margin-right: 0.25rem;
  margin-left: 0;
}

.panch[dir="rtl"] .pc-head select {
  padding-right: 0.75rem;
  padding-left: 1.75rem;
  background-position: left 0.7rem center;
}

.home.panch[dir="rtl"] .pc-pred-list {
  padding-right: 1.2rem;
  padding-left: 0;
}

/* times, ranges, degrees and the time zone stay left to right inside right-to-left text */
.panch[dir="rtl"] .pc-range,
.panch[dir="rtl"] .pc-times strong,
.panch[dir="rtl"] .pc-stat strong {
  direction: ltr;
  unicode-bidi: isolate;
}
