/* --- START OF styles.css (Yellowish Orange Theme) --- */

/* Root colors for easier theme management */
:root {
    --color-primary: #E65100; /* Deep Orange */
    --color-primary-dark: #BF360C; /* Darker Orange for hover */
    --color-secondary: #FFB74D; /* Light Orange */
    --color-secondary-dark: #FF9800; /* Darker Light Orange for hover */
    --color-background: #FFF3E0; /* Very Light Orange / Cream */
    --color-surface: #FFFFFF; /* White or near white for cards/forms */
    --color-border: #FFCC80; /* Lighter Orange for borders */
    --color-divider: #FFECB3; /* Very Light Yellow for dividers */
    --color-text-dark: #4E342E; /* Dark Brown for headings */
    --color-text-medium: #6D4C41; /* Medium Brown */
    --color-text-light: #8D6E63; /* Light Brown */

    /* Status colors (keeping standard red/green/yellow/blue for clarity) */
    --color-status-bad: #C62828; /* Red */
    --color-status-good: #388E3C; /* Green */
    --color-status-warning: #FBC02D; /* Yellow */
    --color-status-neutral: #1976D2; /* Blue */
}


.astrology-dashboard {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--color-background); /* Yellowish orange background */
  color: var(--color-text-medium); /* Default text color */
}

h1, h2, h3 {
    color: var(--color-text-dark); /* Darker headings */
}

.dashboard-container {
  display: flex;
  gap: 30px;
  /* Allow container to wrap on smaller screens */
  flex-wrap: wrap;
}

.left-panel {
  flex: 1; /* Give less flex basis to the left panel */
  min-width: 500px; /* Ensure left panel has a minimum readable width */
  min-height: 80vh; /* Give left panel a minimum height */
}

.right-panel {
  flex: 1.5; /* Give more flex basis to the right panel */
  min-width: 500px; /* Ensure right panel has a minimum usable width */
  max-width: 800px; /* Allow AI panel to grow but set a max */
  height: calc(100vh - 100px - var(--agbd-nav-h, 0px)); /* Keep height setting for fixed chat panel */
  display: flex;
  flex-direction: column;
  /* Optional: Add subtle border or background to visually separate */
  border-left: 1px solid var(--color-border); /* Orange border */
  padding-left: 30px;
  margin-left: -30px; /* Counteract gap */
}

/* Narrowing the birth details form */
.birth-chart-form {
  background: var(--color-surface); /* Pure white background for form */
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Slightly softer shadow */
  max-width: 600px; /* Explicitly narrow the form container */
  margin-left: auto; /* Center the form if max-width is less than panel width */
  margin-right: auto;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.form-section {
  margin-bottom: 20px;
  flex: 1;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--color-border); /* Orange border */
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  color: var(--color-text-medium);
  background-color: #fff; /* Ensure input background is white */
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border); /* Orange border */
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  color: var(--color-text-medium);
  background-color: #fff; /* Ensure input background is white */
}

.generate-btn {
  background: var(--color-primary); /* Deep Orange */
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.generate-btn:hover:not(:disabled) {
  background: var(--color-primary-dark); /* Darker Orange */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.generate-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}


.generate-btn.small {
  padding: 8px 15px;
  font-size: 14px;
  width: auto;
}

.generate-btn.secondary {
  background: var(--color-secondary); /* Light Orange */
  margin-top: 10px;
}

.generate-btn.secondary:hover:not(:disabled) {
  background: var(--color-secondary-dark); /* Darker Light Orange */
}

#loadingIndicator {
  text-align: center;
  padding: 30px;
  color: var(--color-text-light); /* Light Brown */
}

.spinner {
  border: 4px solid rgba(var(--color-primary, #E65100), 0.2); /* Use primary color with transparency */
  border-top: 4px solid var(--color-primary); /* Deep Orange */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.spinner.small {
  width: 20px;
  height: 20px;
  border-width: 2px;
  margin: 0 auto 5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#reportContainer {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 30px; /* Add space above report sections */
}

.charts-row {
  display: grid;
  /* Adjust minmax to better fit charts without narrowing */
  grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
  gap: 30px;
}

.chart-section, .data-section {
  background: var(--color-surface); /* White background */
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  /* transition: transform 0.3s ease, box-shadow 0.3s ease; */ /* Removed hover effect */
}

.chart-section h2, .data-section h2 {
  color: var(--color-primary); /* Deep Orange */
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-divider); /* Very Light Yellow */
}

.chart-display {
  min-height: 500px; /* Keep minimum height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background); /* Use background color for chart area */
  border: 1px solid var(--color-border); /* Orange border */
  border-radius: 8px;
  overflow-x: auto; /* Allow chart to scroll if too wide */
}
/* Style for the SVG inside the chart display */
.chart-display svg {
    max-width: 100%; /* Ensure SVG is responsive */
    height: auto;
}


.data-display {
  min-height: 200px; /* Keep minimum height */
  padding: 15px;
  background: var(--color-background); /* Use background color for data display */
  border: 1px solid var(--color-border); /* Orange border */
  border-radius: 8px;
  overflow-x: auto; /* Allow tables to scroll horizontally */
}

.error-message {
  color: var(--color-status-bad); /* Red */
  padding: 15px;
  background: #FBE9E7; /* Very light red */
  border: 1px solid #FFAB91; /* Light red border */
  border-radius: 4px;
  margin-top: 20px;
  text-align: center;
  font-weight: bold;
}

.coordinates-display {
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-text-light); /* Light Brown */
  display: flex;
  justify-content: space-between;
}

/* Table Styles */
.planet-table, .direction-table, .house-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
  min-width: 600px; /* Ensure tables don't get too squished */
}

.planet-table th, .planet-table td,
.direction-table th, .direction-table td,
.house-table th, .house-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--color-border); /* Orange border */
}

.planet-table th, .direction-table th, .house-table th {
  background-color: var(--color-divider); /* Very Light Yellow */
  color: var(--color-text-dark); /* Dark Brown */
  font-weight: 600;
  position: sticky; /* Make headers sticky for horizontal scroll */
  top: 0;
  z-index: 1;
}

.planet-table tr:hover, .direction-table tr:hover, .house-table tr:hover {
  background-color: #FFECB3; /* Slightly darker yellow on hover */
}

/* Status indicators (re-using class names from Vue template) */
.retrograde, .debilitated, .combust, .bad, .vulnerable, .afflicted { /* Added vulnerable and afflicted classes */
  color: var(--color-status-bad); /* Red */
  font-weight: bold;
}

.direct, .exalted, .good, .protected, .benefic { /* Added protected and benefic classes */
  color: var(--color-status-good); /* Green */
  font-weight: bold;
}

.neutral, .less-severe { /* Added less-severe class */
  color: var(--color-status-neutral); /* Blue */
}

.warning {
  color: var(--color-status-warning); /* Yellow */
}

/* AI Chat Styles */
.ai-chat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%; /* Fill the height of the parent (right-panel) */
}

.ai-response {
  background: var(--color-surface); /* White background for chat area */
  padding: 15px;
  border-radius: 8px;
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid var(--color-border); /* Orange border */
  display: flex;
  flex-direction: column;
  gap: 10px;
   box-shadow: inset 0 1px 5px rgba(0,0,0,0.05); /* subtle inset shadow */
}

.ai-message {
  background: #f9f9f9; /* Slight background for messages */
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
  word-wrap: break-word; /* Prevent long words overflowing */
  overflow-wrap: break-word; /* Prevent long words overflowing */
  line-height: 1.5;
}

.ai-message.ai-intro {
  background: var(--color-divider); /* Very Light Yellow */
  border-left: 3px solid var(--color-primary); /* Deep Orange */
  font-style: italic;
  color: var(--color-text-dark); /* Dark Brown */
}

.ai-message.ai-assistant {
  background: var(--color-background); /* Yellowish Orange */
  border-left: 3px solid var(--color-primary); /* Deep Orange */
}

.ai-message.ai-user {
  background: var(--color-surface); /* White background for user */
  border-left: 3px solid var(--color-border); /* Orange border */
  align-self: flex-start; /* Align user messages to the left in the chat flow */
  max-width: 90%;
}
/* Style for the user 'You:' strong tag */
.ai-message.ai-user strong {
    color: var(--color-text-dark); /* Dark Brown for emphasis */
}


.ai-message.ai-error {
  background: #FBE9E7; /* Very light red */
  border-left: 3px solid var(--color-status-bad); /* Red */
  font-weight: bold;
  color: var(--color-status-bad); /* Red */
}


.ai-message h3, .ai-message h4 {
  color: var(--color-primary); /* Deep Orange */
  margin-top: 0;
  margin-bottom: 8px;
}

.ai-message ul {
  padding-left: 20px;
  margin: 8px 0;
}

.ai-message li {
  margin-bottom: 6px;
}

.ai-message p {
  margin: 8px 0;
  line-height: 1.6; /* Improve readability */
}

.ai-message p:first-child {
    margin-top: 0;
}
.ai-message p:last-child {
    margin-bottom: 0;
}


.ai-message strong {
  font-weight: 600;
  color: var(--color-text-dark); /* Dark Brown */
}

.ai-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-input-container input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--color-border); /* Orange border */
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  color: var(--color-text-medium);
  background-color: #fff; /* Ensure input background is white */
}

.quick-questions {
  margin-top: 10px;
  font-size: 14px;
  display: flex; /* Use flex for quick questions */
  flex-wrap: wrap; /* Allow quick questions to wrap */
  gap: 8px; /* Space between quick questions */
  align-items: center;
}

.quick-questions p {
  margin: 0 8px 0 0; /* Adjust margin */
  color: var(--color-text-medium); /* Medium Brown */
  font-weight: bold;
}

.quick-question {
  display: inline-block; /* Keep inline-block for layout */
  background: var(--color-divider); /* Very Light Yellow */
  padding: 6px 12px;
  border-radius: 15px;
  /* margin-right: 8px; Removed margin-right, using gap on parent */
  /* margin-bottom: 8px; Removed margin-bottom, using gap on parent */
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  border: 1px solid var(--color-border); /* Orange border */
  color: var(--color-text-dark); /* Dark Brown */
}

.quick-question:hover:not(:disabled) {
  background: #FFECB3; /* Slightly darker yellow */
  transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.quick-question:disabled {
    background-color: #eee;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Highlight dasha planets */
.dasha-planet {
  font-weight: bold;
  color: var(--color-text-dark); /* Dark Brown */
  background-color: var(--color-divider); /* Very Light Yellow */
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap; /* Prevent wrapping */
}

/* Status indicators already defined above */


/* --- Collapsible AI Message Styles --- */
.ai-message-header {
    font-weight: bold;
    cursor: pointer;
    padding-right: 20px; /* Space for the indicator */
    position: relative;
    color: var(--color-primary); /* Deep Orange */
    border-bottom: 1px solid var(--color-divider); /* Very Light Yellow */
    margin-bottom: 10px; /* Space below header */
    padding-bottom: 5px;
}

/* Hide the header for the introductory message and the last message */
.ai-message.ai-intro .ai-message-header,
.ai-response .ai-message:last-of-type .ai-message-header {
    display: none;
}

/* Style for the collapse/expand indicator */
.ai-message-indicator {
    position: absolute;
    right: 0;
    top: 5px; /* Align with header text */
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.2s ease;
    color: var(--color-text-light); /* Light Brown */
}

.ai-message-indicator.collapsed {
    transform: rotate(-90deg); /* Arrow pointing down when collapsed */
}

/* Styles for the content area */
.ai-message-content {
    /* padding-top: 10px; No need, margin-bottom on header provides space */
    /* Managed by Vue's v-if */
    /* display: none; */
}

/* Styles for messages when collapsed */
.ai-message.collapsed .ai-message-content {
    display: none; /* Vue handles this, but good for clarity */
}
.ai-message.collapsed .ai-message-indicator {
     transform: rotate(-90deg);
}

/* Styles for messages when expanded */
.ai-message:not(.collapsed) .ai-message-indicator {
     transform: rotate(0deg); /* Arrow pointing up when expanded */
}


/* Adjusted AI loading spinner */
.ai-loading {
    text-align: center;
    margin-top: 10px;
    color: var(--color-text-light); /* Light Brown */
}

@media (max-width: 1200px) {
  /* Adjust flex basis for slightly smaller screens */
  .left-panel {
      min-width: 400px;
  }
   .right-panel {
      min-width: 400px;
  }
  .charts-row {
      grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  }
   .planet-table, .direction-table, .house-table {
      min-width: 500px;
   }
}


@media (max-width: 1024px) {
  .dashboard-container {
    flex-direction: column;
    gap: 20px; /* Reduce gap when stacking */
  }

  .left-panel {
    min-width: 100%; /* Allow left panel to take full width */
    min-height: auto; /* Remove fixed height constraint */
    padding-right: 0;
  }

  .right-panel {
    min-width: 100%; /* Allow right panel to take full width */
    height: auto; /* Allow height to grow with content */
    max-width: 100%;
    padding-left: 0; Weirder left padding */
    margin-left: 0; /* Remove negative margin */
    border-left: none; /* Remove vertical border */
    border-top: 1px solid var(--color-border); /* Add horizontal border instead */
    padding-top: 20px;
  }

  .birth-chart-form {
      max-width: 100%; /* Allow form to stretch in column layout */
  }


  .ai-chat-container {
      height: 60vh; /* Give AI chat a fixed height on smaller screens to ensure scrolling */
      min-height: 300px; /* Minimum height for chat */
  }

  .charts-row {
    grid-template-columns: 1fr; /* Stack charts on top of each other */
  }
   .planet-table, .direction-table, .house-table {
      min-width: 100%; /* Ensure tables take full width but retain scroll */
   }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .input-group {
      flex-direction: column; /* Stack date/time inputs */
      gap: 8px;
  }

  .input-group input {
      padding: 10px;
  }

  .generate-btn {
      padding: 10px 20px;
      font-size: 15px;
  }


  .planet-table, .direction-table, .house-table {
    font-size: 12px;
    /* Already using overflow-x: auto */
  }

  .planet-table th, .planet-table td,
  .direction-table th, .direction-table td,
  .house-table th, .house-table td {
    padding: 8px 10px;
  }

  .ai-input-container {
    flex-direction: column;
  }

  .ai-input-container button {
    width: 100%;
  }

  .ai-chat-container {
      height: 50vh; /* Adjust height for very small screens */
      min-height: 250px;
  }

  .quick-questions {
      flex-direction: column; /* Stack quick questions */
      align-items: stretch; /* Stretch buttons */
      gap: 5px;
  }
   .quick-questions p {
       margin-right: 0;
       margin-bottom: 5px;
   }
   .quick-question {
       text-align: center;
   }
}
/* --- END OF styles.css (Yellowish Orange Theme) --- */