html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #151832 0%, #050711 55%, #02030a 100%);
  color: #f4f5ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Shell layout */
.astronews-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Top date bar */
.astronews-datebar{
  height: 60px;        /* choose your bar height */
  flex: 0 0 60px;
  display: flex;
  align-items: center; /* centers the iframe box in the bar */
}

.astronews-datebar iframe{
  width: 100%;
  height: 100%;
  border: none;
  display: block;      /* removes baseline gap */
}



/* Main content */
.astronews-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  gap: 16px;
}

/* On wider screens, arrange cards in two columns */
@media (min-width: 900px) {
  .astronews-content {
    padding: 20px 24px 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* equal width */
    align-items: start;
  }

  .moon-card {
    grid-column: 1 / 2;
  }

  .horoscope-card {
    grid-column: 1 / 2;
  }

  .planets-card {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
  }
}


/* Generic card */
.card {
  position: relative;
  border-radius: 14px;
  padding: 16px 18px;
  background: radial-gradient(circle at top left, rgba(84, 112, 255, 0.18), rgba(8, 10, 26, 0.96));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

/* Card headings */
.card h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

/* Specific: Moon card */
.moon-card {
  max-width: 520px;
}

.moon-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 6px 0;
  gap: 10px;
}

.moon-row .label {
  font-size: 0.9rem;
  opacity: 0.82;
}

.moon-row .value {
  font-size: 0.95rem;
  font-weight: 600;
}

.moon-row .value.badge {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(5, 240, 178, 0.08);
  font-variant-numeric: tabular-nums;
}

.moon-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Horoscope card */
.horoscope-card {
  max-width: 640px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.horoscope-text {
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #f5f6ff;
}

.horoscope-text::first-line {
  font-weight: 600;
}

/* Pills / buttons */
.btn-pill {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle at top, rgba(98, 150, 255, 0.4), rgba(13, 26, 76, 0.95));
  color: #ffffff;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 80ms ease-out,
    border-color 140ms ease-out;
}

.btn-pill:hover {
  background: radial-gradient(circle at top, rgba(141, 181, 255, 0.8), rgba(21, 32, 96, 1));
  box-shadow: 0 0 0 1px rgba(132, 179, 255, 0.8), 0 10px 24px rgba(0, 0, 0, 0.7);
  border-color: rgba(179, 206, 255, 0.95);
}

.btn-pill:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

/* Planets card */
.planets-card {
  overflow: hidden;
}

.planets-card h2 {
  margin-bottom: 12px;
}

/* Table styling */
.astronews-planets {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 10px;
  background: rgba(3, 7, 18, 0.85);
}

.astronews-planets thead {
  background: linear-gradient(to right, rgba(111, 139, 255, 0.55), rgba(88, 111, 220, 0.75));
}

.astronews-planets th,
.astronews-planets td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.astronews-planets th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fdfdff;
  white-space: nowrap;
}

.astronews-planets td {
  color: #e3e6ff;
}

/* Planet column emphasis */
.astronews-planets .planet-name {
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Zodiac text */
.astronews-planets .planet-sign {
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}

/* Attribute column */
.attr-cell {
  font-size: 0.8rem;
  opacity: 0.82;
  font-style: italic;
}

/* Alternate row subtle striping when no score */
.astronews-planets tbody tr:nth-child(odd):not(.has-score) {
  background: rgba(13, 16, 36, 0.8);
}

/* Highlighted rows with JSON-based scores */
.astronews-planets tbody tr.has-score {
  position: relative;
  transition: background-image 180ms ease-out, background-color 180ms ease-out, transform 80ms ease-out;
}

.astronews-planets tbody tr.has-score:hover {
  transform: translateY(-1px);
}

/* Keep text readable over colored background */
.astronews-planets tbody tr.has-score td {
  color: #f9fbff;
}

/* Hint below table */
.planets-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  opacity: 0.72;
  line-height: 1.4;
}

.planets-hint code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(12, 16, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Small screens tweaks */
@media (max-width: 599px) {
  .card {
    padding: 14px 12px;
  }

  .astronews-planets th,
  .astronews-planets td {
    padding: 6px 8px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header h2 {
    margin-bottom: 4px;
  }

  .btn-pill {
    align-self: flex-start;
  }
}


/* === Horoscope mode buttons group (Daily / Birth / icon toggle) === */

.horoscope-mode-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border-radius: 999px;
  background: radial-gradient(circle at top,
    rgba(120, 144, 255, 0.22),
    rgba(7, 12, 36, 0.95)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

/* Individual mode buttons (Daily / Birth / icon) */
.mode-btn {
  border: none;
  background: transparent;
  color: rgba(244, 245, 255, 0.78);
  font-size: 1.05rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    background 140ms ease-out,
    color 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 80ms ease-out;
}

/* Active state for Daily / Birth */
.mode-btn.is-active {
  background: radial-gradient(circle at top,
    rgba(165, 189, 255, 0.95),
    rgba(53, 82, 210, 1)
  );
  color: #050711;
  box-shadow:
    0 0 0 1px rgba(205, 220, 255, 0.9),
    0 8px 18px rgba(0, 0, 0, 0.75);
  transform: translateY(-1px);
}

.mode-btn:hover {
  transform: translateY(-1px);
}

.mode-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

/* Icon-only toggle button (uses gemstone / horoscope icon) */
.toggle-btn {
  padding: 15px;
  margin-left: 10px;
  min-width: auto;
  width: 38px;
  height: 38px;
}

.mode-toggle-icon-img {
  display: block;
  width: 45px;
  height: 45px;
  pointer-events: none;
}

/* === Dynamic title under buttons === */

#horoscope-title,
.horoscope-dynamic-title {
  margin-top: 6px;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 245, 255, 0.7);
  opacity: 0.9;
}


.horoscope-text-wrap{
  position: relative;
}

/* Icon-only regenerate button pinned to top-right of the text box */
.btn-refresh-icon{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 45px;
  height: 45px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: radial-gradient(circle at top, rgba(98,150,255,0.35), rgba(13,26,76,0.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition:
    background 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 80ms ease-out,
    border-color 140ms ease-out;
}

.btn-refresh-icon:hover{
  background: radial-gradient(circle at top, rgba(141,181,255,0.75), rgba(21,32,96,1));
  box-shadow: 0 0 0 1px rgba(132,179,255,0.8), 0 10px 24px rgba(0,0,0,0.7);
  border-color: rgba(179,206,255,0.95);
  transform: translateY(-1px);
}

.btn-refresh-icon:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
}

.btn-refresh-icon img{
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

/* Give the text area some top-right breathing room so the icon doesn’t overlap text */
.horoscope-text{
  padding-right: 56px;
  padding-top: 6px;
}


/* Hide scrollbars but keep scrolling */
.astronews-content{
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/old Edge */
}
.astronews-content::-webkit-scrollbar{
  width: 0;
  height: 0;                      /* Chrome/Safari/Edge */
}


html, body{
  overflow: hidden;
}


/* FIX: make the text itself full width (safe) */
.horoscope-card,
.card-header,
.horoscope-text-wrap{
  min-width: 0;
}

.horoscope-text{
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;

  overflow-wrap: anywhere;
  word-break: break-word;
}


/* =========================================
   FIX: last line under planets table clipped on small screens
   ========================================= */
@media (max-width: 599px){

  /* 1) Never clip the planets card content on mobile */
  .planets-card{
    overflow: visible !important;   /* overrides the base overflow:hidden */
    padding-bottom: 50px;           /* gives the hint breathing room */
  }

  /* 2) Let the page scroll far enough so the last line can be seen */
  .astronews-content{
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

/* FIX (desktop): last line clipped at bottom of scroll container */
@media (min-width: 900px){
  .astronews-content{
    padding-bottom: 48px; /* increase if you still see clipping */
    scroll-padding-bottom: 48px;
  }
}
