:root {
  --bg-primary: #0a0a0f;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-tertiary: #0f0f16;
  --text-primary: #e8e8f0;
  --text-muted: #9999aa;
  --text-bright: #ffffff;
  --accent-gold: #f4c430;
  --accent-blue: #4a9eff;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --border: #2a2a38;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 20px;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== HEADER ==================== */

.top-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.title {
  font-size: 1.8rem;
  color: var(--accent-gold);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 90px;
  height: 90px;
  vertical-align: middle;
  margin-left: 6px;
}

.today-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.right {
  display: flex;
  gap: 10px;
  align-items: center;
}

#profileSelect {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}

.action-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #3a7edf;
}

.action-btn.danger {
  background: var(--accent-red);
}

.action-btn.danger:hover {
  background: #d63333;
}

/* ==================== CARDS ==================== */

.summary-card,
.text-card,
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== PROFILE SUMMARY ==================== */

.profile-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-yellow {
  background: rgba(244, 196, 48, 0.2);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.quick-insight {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
}

/* ==================== DETAIL ROWS ==================== */

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.value {
  color: var(--text-bright);
  font-weight: 500;
  text-align: right;
}

/* ==================== DASHA TIMELINE ==================== */

.dasha-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.dasha-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dasha-current {
  color: var(--text-bright);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 1rem;
}

.dasha-timeline {
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-gold) 100%);
  height: 8px;
  border-radius: 4px;
  position: relative;
  margin: 12px 0;
}

.dasha-marker {
  position: absolute;
  width: 3px;
  height: 16px;
  background: var(--text-bright);
  top: -4px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.dasha-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==================== TRANSIT ASPECTS ==================== */

.transit-aspects-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.aspect-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.aspect-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  margin: 8px 0;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.aspect-item.beneficial {
  border-left-color: var(--accent-green);
}

.aspect-item.challenging {
  border-left-color: var(--accent-red);
}

.aspect-item.neutral {
  border-left-color: var(--text-muted);
}

.aspect-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.aspect-dot.beneficial {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.aspect-dot.challenging {
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

.aspect-dot.neutral {
  background: var(--text-muted);
}

.aspect-content {
  flex: 1;
}

.aspect-title {
  color: var(--text-bright);
  font-weight: 500;
  margin-bottom: 4px;
}

.aspect-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.aspect-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
}

.aspect-badge.high {
  background: var(--accent-red);
  color: white;
}

.aspect-badge.medium {
  background: var(--accent-gold);
  color: black;
}

.aspect-badge.low {
  background: var(--text-muted);
  color: white;
}

/* ==================== HOROSCOPE ==================== */

.horoscope-text {
  line-height: 1.8;
  color: var(--text-primary);
  margin-top: 16px;
  font-size: 0.95rem;
}

.horoscope-text p {
  margin-top: 12px;
}

.horoscope-highlight {
  color: var(--accent-gold);
  font-weight: 500;
}

.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(74, 158, 255, 0.2);
  color: var(--accent-blue);
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 8px;
  font-weight: 600;
}

/* ==================== TRANSIT TIMELINE ==================== */

.transit-timeline {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-time {
  min-width: 80px;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.timeline-event {
  flex: 1;
}

.timeline-title {
  color: var(--text-bright);
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.timeline-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.priority-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
}

.priority-badge.priority-high {
  background: var(--accent-red);
  color: white;
}

.priority-badge.priority-medium {
  background: var(--accent-gold);
  color: black;
}

.priority-badge.priority-low {
  background: var(--text-muted);
  color: white;
}

/* ==================== HOUSE GRID ==================== */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.house-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s;
  position: relative;
}

.house-box:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.house-box.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(244, 196, 48, 0.1) 100%);
}

.house-box.active::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.2);
  }
}

.house-title {
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.house-association {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0;
  font-style: italic;
}

.house-advice {
  font-size: 0.85rem;
  color: var(--text-bright);
  line-height: 1.4;
  margin-top: 8px;
}

.house-advice strong {
  color: var(--accent-gold);
  font-weight: 600;
}

.house-activity {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== SHEET (MODAL) ==================== */

.sheet {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.sheet.open {
  display: flex;
}

.sheet-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.sheet-content h2 {
  color: var(--accent-gold);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.sheet-content label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 16px;
  margin-bottom: 6px;
}

.sheet-content input,
.sheet-content select {
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.sheet-buttons {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.danger-button {
  flex: 1;
  min-width: 100px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-button {
  background: var(--accent-blue);
  color: white;
}

.primary-button:hover {
  background: #3a7edf;
}

.secondary-button {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.secondary-button:hover {
  background: var(--bg-card-hover);
}

.danger-button {
  background: var(--accent-red);
  color: white;
}

.danger-button:hover {
  background: #d63333;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .right {
    width: 100%;
    flex-wrap: wrap;
  }

  #profileSelect {
    flex: 1;
  }

  .title {
    font-size: 1.5rem;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .sheet-content {
    width: 95%;
    padding: 20px;
  }
}

/* ==================== UTILITIES ==================== */

.section-divider {
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
