/* ============================================
   Vedic Milan — Cosmic Theme Styles
   ============================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(ellipse at top, #1e0a47 0%, #0b0524 50%, #000 100%);
  min-height: 100vh;
}

/* Starfield layers */
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.star.twinkle { animation: twinkle 4s ease-in-out infinite; }

/* Cosmic card */
.card-cosmic {
  background: linear-gradient(160deg,
    rgba(124, 58, 237, 0.15) 0%,
    rgba(91, 33, 182, 0.10) 50%,
    rgba(11, 5, 36, 0.40) 100%);
  border: 1px solid rgba(167, 139, 250, 0.20);
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.card-cosmic:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 197, 66, 0.45);
  box-shadow: 0 10px 40px -10px rgba(245, 197, 66, 0.30);
}

/* Glowing button */
.btn-cosmic {
  background: linear-gradient(90deg, #f5c542 0%, #ff7e9d 100%);
  color: #0b0524;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(245, 197, 66, 0.30);
  transition: all .2s ease;
}

.btn-cosmic:hover {
  box-shadow: 0 8px 30px rgba(245, 197, 66, 0.55);
  transform: translateY(-1px);
}

.btn-cosmic:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* Inputs */
.input-cosmic {
  width: 100%;
  background: rgba(11, 5, 36, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #ede9fe;
  transition: border-color .2s, box-shadow .2s;
}

.input-cosmic:focus {
  outline: none;
  border-color: #f5c542;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.20);
}

.input-cosmic::placeholder { color: rgba(237, 233, 254, 0.40); }

.input-cosmic.invalid {
  border-color: #ff7e9d;
  box-shadow: 0 0 0 3px rgba(255, 126, 157, 0.20);
}

/* Loading spinner */
.spinner {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(245, 197, 66, 0.2);
  border-top-color: #f5c542;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Score ring */
.score-ring {
  --p: 0;
  --c: #f5c542;
  width: 180px; height: 180px;
  border-radius: 50%;
  background:
    conic-gradient(var(--c) calc(var(--p) * 1%),
                   rgba(167, 139, 250, 0.15) 0);
  display: grid; place-items: center;
  position: relative;
}
.score-ring::before {
  content: ""; position: absolute; inset: 12px;
  background: #0b0524; border-radius: 50%;
}
.score-ring .score-text {
  position: relative; z-index: 1;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 2.75rem;
  color: #f5c542;
}

/* Koota bar */
.koota-bar {
  height: 8px;
  background: rgba(167, 139, 250, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.koota-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f5c542, #ff7e9d);
  border-radius: 999px;
  transition: width 1s ease;
}

/* Section divider */
.divider-cosmic {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245, 197, 66, 0.4) 50%,
    transparent 100%);
}

/* Hindi numerals */
.hindi-num { font-family: 'Noto Sans Devanagari', sans-serif; }

/* Print-friendly results */
@media print {
  body { background: white !important; color: black !important; }
  header, footer, .no-print { display: none !important; }
  .card-cosmic { border: 1px solid #ccc !important; box-shadow: none !important; background: white !important; }
  .score-ring .score-text { color: #b8860b !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Tooltip */
.tooltip {
  position: relative;
}
.tooltip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e0a47;
  color: #ede9fe;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 50;
  border: 1px solid rgba(245, 197, 66, 0.4);
}

/* SVG chart wheel */
.birth-chart svg { max-width: 100%; height: auto; }
.birth-chart .house-num {
  fill: #f5c542;
  font-family: 'Cinzel', serif;
  font-weight: 700;
}
.birth-chart .planet {
  fill: #ede9fe;
  font-size: 11px;
}

/* ============================================
   Date & Time Picker (segmented inputs)
   ============================================ */
.dt-picker {
  display: block;
  width: 100%;
}

.dt-picker .dt-segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(11, 5, 36, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 0.75rem;
  padding: 6px;
  position: relative;
}

.dt-picker .dt-segments:focus-within {
  border-color: #f5c542;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.20);
}

.dt-picker.invalid .dt-segments {
  border-color: #ff7e9d;
  box-shadow: 0 0 0 3px rgba(255, 126, 157, 0.20);
}

.dt-picker .dt-seg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 0.5rem;
  background: rgba(11, 5, 36, 0.45);
  cursor: text;
  transition: background .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}

.dt-picker .dt-seg:hover { background: rgba(124, 58, 237, 0.18); }

.dt-picker .dt-seg.is-focused {
  background: rgba(245, 197, 66, 0.12);
  outline: 2px solid rgba(245, 197, 66, 0.6);
  outline-offset: -2px;
}

.dt-picker .dt-seg .dt-input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  text-align: center;
  color: #ede9fe;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  letter-spacing: 0.02em;
}

.dt-picker .dt-seg .dt-input::-webkit-outer-spin-button,
.dt-picker .dt-seg .dt-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dt-picker .dt-seg .dt-input::placeholder {
  color: rgba(237, 233, 254, 0.30);
  font-weight: 400;
}

.dt-picker .dt-seg .dt-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(237, 233, 254, 0.45);
  margin-top: 2px;
  pointer-events: none;
}

.dt-picker .dt-seg .dt-input:focus { color: #f5c542; }

.dt-picker .dt-sep {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245, 197, 66, 0.6);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}

.dt-picker .dt-sep.s1 { left: calc(20% - 4px); }
.dt-picker .dt-sep.s2 { left: calc(40% - 4px); }
.dt-picker .dt-sep.s3 { left: calc(60% - 4px); }
.dt-picker .dt-sep.s4 { left: calc(80% - 4px); }

.dt-picker .dt-preview {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(237, 233, 254, 0.55);
  min-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dt-picker .dt-preview.is-valid { color: #86efac; }

.dt-picker .dt-help {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(237, 233, 254, 0.35);
  text-align: center;
}

/* Quick presets row */
.dt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}

.dt-presets button {
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #ede9fe;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}

.dt-presets button:hover,
.dt-presets button:focus-visible {
  background: rgba(245, 197, 66, 0.18);
  border-color: rgba(245, 197, 66, 0.55);
  outline: none;
}

.dt-presets button:active { transform: scale(0.96); }

/* "I don't know exact time" toggle */
.dt-unknown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(237, 233, 254, 0.55);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.dt-unknown input { accent-color: #f5c542; }

.dt-unknown.is-active {
  color: #f5c542;
}

/* Smaller screens: 2-row layout */
@media (max-width: 380px) {
  .dt-picker .dt-segments {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 4px;
  }
  .dt-picker .dt-seg { min-height: 48px; }
  .dt-picker .dt-seg .dt-input { font-size: 0.95rem; }
  .dt-picker .dt-seg .dt-label { font-size: 8px; }
}
