@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,800;1,600&display=swap');

:root {
  --bg-dark: #090d16;
  --card-bg: rgba(22, 30, 46, 0.85);
  --card-border: rgba(217, 119, 6, 0.25);
  --primary-gold: #fbbf24;
  --secondary-gold: #d97706;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-emerald: #10b981;
  --accent-blue: #3b82f6;
  --chat-user-bg: #1e3a8a;
  --chat-assistant-bg: #1e293b;
}

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

body {
  font-family: 'Hind Siliguri', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(217, 119, 6, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.6;
  padding-bottom: 60px;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* Header Banner */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.app-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.app-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Card Styling */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-gold);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e5e7eb;
}

.required-star {
  color: #ef4444;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

.dob-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Lo Shu Grid Graphical Display */
.loshu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.loshu-grid {
  display: grid;
  grid-template-columns: repeat(3, 85px);
  grid-template-rows: repeat(3, 85px);
  gap: 8px;
  background-color: rgba(30, 41, 59, 0.8);
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--secondary-gold);
}

.loshu-cell {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-gold);
  position: relative;
}

.loshu-cell.empty {
  color: rgba(255, 255, 255, 0.2);
}

.cell-pos {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Key Metrics Bar */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.metric-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-gold);
}

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

.metric-planet {
  font-size: 0.85rem;
  color: var(--accent-emerald);
  margin-top: 4px;
}

/* Key Value Pairs Table */
.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.details-table th, .details-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.details-table th {
  color: var(--primary-gold);
  width: 35%;
  font-weight: 500;
}

/* Chat UI (AI Style) */
.chat-card {
  border-color: rgba(59, 130, 246, 0.3);
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 88%;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user .avatar {
  background: var(--accent-blue);
}

.message-bubble {
  background: var(--chat-assistant-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 1rem;
  color: #f3f4f6;
  white-space: pre-wrap;
  line-height: 1.6;
}

.user .message-bubble {
  background: var(--chat-user-bg);
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-left: 48px;
}

.option-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover {
  background: var(--primary-gold);
  color: #0f172a;
  transform: translateY(-1px);
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--chat-assistant-bg);
  border-radius: 12px;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.disclaimer-box {
  margin-top: 20px;
  padding: 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #fca5a5;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.4);
  border-radius: 3px;
}

@media (max-width: 640px) {
  .app-title { font-size: 1.7rem; }
  .loshu-grid { grid-template-columns: repeat(3, 70px); grid-template-rows: repeat(3, 70px); }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .chat-options { padding-left: 0; }
}

/* Print Stylesheet for clean PDF Export */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, #formSection, #chatSection, .report-header-actions, .disclaimer-box {
    display: none !important;
  }
  .card {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    color: #000000 !important;
    padding: 0 !important;
  }
  .metric-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
  }
  .metric-number, .metric-label, .metric-planet, .card-title, h3 {
    color: #0f172a !important;
  }
  .details-table th, .details-table td {
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
  }
  .loshu-cell {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
  }
}

