/* Daily Graha Report Page
   C:\xampp\htdocs\jathagam.ai\frontend\static\css\reports\daily_graha_report.css */

.dgr-wrapper {
  background: linear-gradient(135deg, #fdf6ff 0%, #f3eaff 100%);
  border-radius: 16px;
  margin: 8px auto 16px;
  animation: dgr-subtle-glow 6s ease-in-out infinite;
}

.dgr-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
}

/* Header */
.dgr-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
  margin: 10px 0 10px;
}

.dgr-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #7b2cbf;
  margin: 6px 0;
  text-align: center;
  position: relative;
}

.dgr-title::after {
  content: '';
  display: block;
  height: 3px;
  width: 52px;
  background: linear-gradient(90deg, #ffd54a, #ffd54a 60%, rgba(123, 44, 191, 0));
  border-radius: 2px;
  margin: 6px auto 0;
  opacity: .95;
}

.dgr-title.dgr-glow {
  text-shadow: 0 6px 18px rgba(123, 44, 191, 0.08),
               0 2px 6px rgba(123, 44, 191, 0.04);
}

.dgr-date {
  font-size: .82rem;
  color: #6b5c7b;
}

/* make the date right-aligned and on its own line below the title for small screens */
.dgr-date {
  width: 100%;
  text-align: right;
  margin-top: 4px;
}

.dgr-date-chip {
  display: inline-block;
  background: rgba(123, 44, 191, 0.08);
  color: #4b2166;
  padding: .24rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(123, 44, 191, 0.18);
  font-weight: 700;
  font-size: .82rem;
  transform-origin: center;
  animation: dgr-heartbeat 4s ease-in-out infinite;
}

@media (min-width: 760px) {
  .dgr-head {
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    position: relative;
  }
  .dgr-title {
    font-size: 1.15rem;
    margin: 0 auto;
  }
  .dgr-date {
    position: absolute;
    right: 12px;
    top: 8px;
  }
}

/* Tabs */
.dgr-tabs {
  display: flex;
  border-radius: 999px;
  background: #f3e9ff;
  padding: 3px;
  margin: 4px 0 10px;
}

.dgr-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: .35rem .2rem;
  font-size: .86rem;
  font-weight: 700;
  border-radius: 999px;
  color: #5b3c82;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.dgr-tab-btn.is-active {
  background: #ffffff;
  color: #7b2cbf;
  box-shadow: 0 2px 8px rgba(123, 44, 191, 0.18);
}

.dgr-tabs-content {
  margin-top: 6px;
}

.dgr-tab-panel {
  display: none;
}

.dgr-tab-panel.is-active {
  display: block;
}

/* Tone block */
.dgr-tone {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ead8ff;
  padding: .7rem .8rem;
  margin-bottom: 12px;
}

.tone-label {
  display: inline-block;
  font-size: .88rem;
  font-weight: 700;
  color: #7b2cbf;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}

.tone-text {
  font-size: .9rem;
  color: #2f2349;
  line-height: 1.6;
}

.tone-text.muted {
  color: #6b5c7b;
}

/* Score grid */
.dgr-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* show 3 columns on wider viewports */
  gap: .6rem;
  margin-bottom: 12px;
}

.dgr-score-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ead8ff;
  padding: .55rem .7rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 72px; /* keep cards visually even */
}

.dgr-score-card h5 {
  margin: 0 0 .25rem 0;
  font-size: .82rem;
  font-weight: 700;
  color: #5b2a93;
}


@media (max-width: 520px) {
  /* on common mobile widths, use 2 columns so 6 items become 2x3 */
  .dgr-score-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Summary block */
.dgr-block {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ead8ff;
  padding: .75rem .8rem;
  margin-bottom: 10px;
}

.dgr-block-title {
  margin: 0 0 .4rem 0;
  font-size: .95rem;
  font-weight: 800;
  color: #7b2cbf;
}

.dgr-summary-short {
  margin: 0 0 .25rem 0;
  font-size: .9rem;
  color: #37255a;
}

.dgr-summary-long {
  margin: 0;
  font-size: .9rem;
  color: #2d2448;
}

/* Thematic sections */
.dgr-grid-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
  margin-bottom: 10px;
}

.dgr-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ead8ff;
  padding: .7rem .85rem;
}

.dgr-section h5 {
  margin: 0 0 .3rem 0;
  font-size: .9rem;
  font-weight: 800;
  color: #7b2cbf;
}

.dgr-section p {
  margin: 0;
  font-size: .88rem;
  color: #2c2445;
  line-height: 1.65;
}

@media (min-width: 760px) {
  .dgr-grid-sections {
    grid-template-columns: 1fr 1fr;
  }
}

/* Do / Don’t / Remedies group */
.dgr-actions .dgr-section + .dgr-section {
  margin-top: .55rem;
}

.dgr-rasi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .4rem;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ead8ff;
  padding: .35rem .5rem;
}

/* let chips keep their intrinsic width but not force layout issues */
.dgr-rasi-chips {
  flex: 0 0 auto;
}

.dgr-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  padding: .22rem .56rem;
  font-size: .65rem;
  line-height: 1.1;
  background: transparent;
}

/* keep the label unbroken, but allow the chip text itself to wrap */
.dgr-chip-label {
  white-space: nowrap;
  font-weight: 700;
  color: inherit;
}

.dgr-chip-text {
  display: inline-block;
  white-space: normal;
  max-width: 42ch; /* reasonable limit to avoid extremely long lines */
  overflow-wrap: anywhere;
}

/* Stronger overrides to prevent other global rules forcing vertical text */
.dgr-rasi-chips .dgr-chip {
  writing-mode: horizontal-tb !important;
}

.dgr-rasi-chips .dgr-chip strong {
  margin-right: .35rem;
}

/* Override any global `.chip` rules (for example `home.css`) that set fixed small sizes */
.dgr-rasi-chips .dgr-chip {
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 88px !important;
  padding: .28rem .6rem !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.dgr-rasi-chips .dgr-chip .dgr-chip-text {
  max-width: 100% !important;
}

.dgr-chip-good {
  background: rgba(34, 197, 94, .08);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, .35);
}

.dgr-chip-caution {
  background: rgba(248, 180, 0, .08);
  color: #92400e;
  border: 1px solid rgba(248, 180, 0, .35);
}

.dgr-teaching {
  /* match other content cards */
  font-size: .86rem;
  color: #312e81;
  background: #fff;
  border: 1px solid #ead8ff;
  border-radius: 14px;
  padding: .75rem .8rem;
  margin: 0;
  line-height: 1.5;
  white-space: normal; /* override .preline so stray newlines don't create gaps */
  box-sizing: border-box;
  width: 100%;
  flex: 1 1 auto; /* allow teaching card to take remaining width in footer row */
}

.dgr-teaching strong {
  display: inline-block;
  margin-right: .45rem;
  font-weight: 800;
}

/* Small screens: stack chips vertically so each .chip appears on its own line */
@media (max-width: 520px) {
  .dgr-rasi-chips {
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
  }
}

/* Very narrow screens: allow chips to truncate with ellipsis */
@media (max-width: 360px) {
  .dgr-chip {
    max-width: calc(100% - 18px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Ensure cards fill grid cells evenly and spacing is consistent */
.dgr-score-grid {
  align-items: stretch;
}

/* Empty state / placeholder */
.dgr-empty {
  margin: 10px 0;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px dashed #d4bfff;
  background: rgba(248, 250, 252, 0.7);
  font-size: .9rem;
  color: #4b5563;
}

.dgr-tab-placeholder {
  text-align: center;
}

/* Bottom CTAs */
.dgr-bottom-ctas {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
}

/* Make CTA buttons equal width and stack as a single column on small screens */
.dgr-bottom-ctas {
  align-items: stretch;
}
.dgr-bottom-ctas .btn-back {
  flex: 1 1 0;
  min-width: 0;
  max-width: 340px; /* prevent overly wide buttons on very wide screens */
  text-align: center;
}

@media (max-width: 520px) {
  .dgr-bottom-ctas {
    flex-direction: column;
    gap: .6rem;
    align-items: stretch;
  }
  .dgr-bottom-ctas .btn-back {
    width: 100%;
    max-width: 100%;
  }
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid #e0c7ff;
  background: #faf5ff;
  color: #4b2166;
  font-size: .85rem;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}

.btn-back:hover {
  background: #f3e8ff;
  box-shadow: 0 2px 8px rgba(123, 44, 191, 0.16);
  transform: translateY(-1px);
}

/* Disclaimer */
.dgr-disclaimer {
  margin-top: 8px;
  font-size: .8rem;
  color: #4b5563;
}

/* Utilities */
.preline {
  white-space: pre-line;
}

/* Animations */
@keyframes dgr-subtle-glow {
  0%   { box-shadow: 0 2px 10px rgba(123, 44, 191, 0.03); }
  50%  { box-shadow: 0 6px 22px rgba(123, 44, 191, 0.06); }
  100% { box-shadow: 0 2px 10px rgba(123, 44, 191, 0.03); }
}

@keyframes dgr-heartbeat {
  0%   { transform: scale(1); }
  10%  { transform: scale(1.06); }
  20%  { transform: scale(1); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dgr-wrapper {
    animation: none;
  }
  .dgr-date-chip {
    animation: none;
  }
}


/* Micro breadcrumb */
.breadcrumb-nav.micro {
  margin: 8px 0 6px;
  font-size: 0.75rem;
  color: var(--muted, #6f6a80);
  display: flex; flex-wrap: wrap; gap: .25rem .5rem;
}
.breadcrumb-nav.micro a { color: var(--brand-700, #6b21a8); text-decoration: none; }
.breadcrumb-nav.micro .sep { opacity: .6; }


/* Breadcrumb */
.breadcrumb-nav { font-size: 0.8rem; color: #6c757d; margin-bottom: 1rem; }
.breadcrumb-nav a { text-decoration: none; color: #7b2cbf; font-weight: 600; }
.breadcrumb-nav { margin: 6px 0 4px; font-size: .9rem; }


/* Micro breadcrumb = tighter vertical rhythm */
.breadcrumb-nav,
.breadcrumb-nav.micro {
  margin-top: 4px !important;
  margin-bottom: 6px !important;
}

/* Graha table tab ------------------------------------------------------ */
.dgr-graha-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.dgr-graha-card {
  background: #fdf7ff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(43, 16, 82, 0.08);
  border: 1px solid rgba(123, 44, 191, 0.08);
}

.dgr-graha-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.dgr-graha-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #3b215f;
  font-size: 0.95rem;
}

.dgr-graha-name {
  white-space: nowrap;
}

.dgr-graha-rasi {
  font-size: 0.8rem;
  color: #7b2cbf;
  font-weight: 500;
}

.dgr-graha-retro {
  font-size: 0.8rem;
  color: #e03a3a;
}

.dgr-graha-attrs {
  margin: 0;
  padding: 0;
}

.dgr-graha-attr-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  padding-top: 2px;
}

.dgr-graha-attr-row dt {
  font-weight: 500;
  color: #6b4a9b;
}

.dgr-graha-attr-row dd {
  margin: 0;
  text-align: right;
  color: #2d2448;
}

.dgr-graha-pada {
  margin-left: 4px;
  font-size: 0.75rem;
  color: #8b5fd3;
}

@media (min-width: 640px) {
  .dgr-graha-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .dgr-graha-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dgr-graha-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: contain;
}

.dgr-rasi-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: contain;
}

.dgr-graha-icon {
  margin-right: 4px;
}

.dgr-rasi-icon {
  margin-left: 4px;
}

.score-badges {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .35rem;
}

/* star row */
.score-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .9rem;
}

.score-star {
  color: #e5d3ff;           /* base (empty) star */
  text-shadow: 0 0 1px rgba(0,0,0,0.05);
}

.score-star.is-filled {
  color: #f59e0b;           /* amber filled star */
}

/* small numeric pill on the side */
.score-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  color: #4b2166;
  background: rgba(123, 44, 191, 0.06);
}
