/**
 * ZWDS Interpretation Styling
 * Professional English interpretation system with expandable sections
 */

/* Interpretation Wrapper */
.zwds-interpretation-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(83, 29, 171, 0.08);
  overflow: hidden;
}

/* Header */
.interpretation-header {
  padding: 32px 24px 24px 24px;
  background: linear-gradient(135deg, #531dab 0%, #722ed1 100%);
  color: #ffffff;
  text-align: center;
}

.interpretation-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.interpretation-subtitle {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
  font-weight: 400;
}

/* Content Area */
.interpretation-content {
  padding: 0;
}

/* Loading State */
.interpretation-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: #8c8c8c;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #531dab;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.interpretation-loading p {
  margin: 0;
  font-size: 16px;
  color: #595959;
}

/* Sections */
.interpretation-sections {
  display: block;
}

.interpretation-section {
  border-bottom: 1px solid #f0f0f0;
}

.interpretation-section:last-child {
  border-bottom: none;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #fafafa;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.section-header:hover {
  background: #f5f5f5;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #262626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.section-toggle {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
  border: 1px solid #d9d9d9;
}

.section-toggle:hover {
  background: #531dab;
  border-color: #531dab;
  color: #ffffff;
}

.toggle-icon {
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

/* Section Content */
.section-content {
  padding: 24px;
  background: #ffffff;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Overview Section */
.overview-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.chart-basics h4,
.key-insights h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #531dab;
}

.basic-info {
  space-y: 8px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-item .label {
  font-weight: 500;
  color: #595959;
}

.info-item .value {
  font-weight: 600;
  color: #262626;
}

.key-insights ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.key-insights li {
  margin-bottom: 8px;
  color: #595959;
}

/* Personality Analysis */
.personality-analysis {
  space-y: 24px;
}

.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.trait-item {
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  border-left: 4px solid #531dab;
}

.trait-name {
  font-weight: 600;
  color: #262626;
  margin-bottom: 4px;
}

.trait-description {
  font-size: 14px;
  color: #595959;
  margin-bottom: 8px;
  line-height: 1.4;
}

.trait-strength {
  font-size: 12px;
  font-weight: 500;
  color: #531dab;
  text-transform: uppercase;
}

.behavioral-patterns p,
.development-areas p {
  line-height: 1.6;
  color: #595959;
  margin-bottom: 16px;
}

.development-areas ul {
  padding-left: 20px;
}

.development-areas li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.development-areas strong {
  color: #262626;
}

/* Career Analysis */
.career-analysis {
  space-y: 24px;
}

.strengths-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.strength-item {
  padding: 12px 16px;
  background: linear-gradient(90deg, #f6ffed 0%, #ffffff 100%);
  border-left: 3px solid #52c41a;
  border-radius: 4px;
}

.strength-item strong {
  color: #262626;
}

.career-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.career-category {
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
}

.career-category h5 {
  margin: 0 0 12px 0;
  color: #531dab;
  font-weight: 600;
}

.career-category ul {
  margin: 0;
  padding-left: 20px;
}

.career-category li {
  margin-bottom: 6px;
  color: #595959;
}

.timeline-periods {
  margin-top: 16px;
  space-y: 12px;
}

.period {
  display: flex;
  padding: 12px 16px;
  background: #f0f5ff;
  border-radius: 6px;
  border-left: 3px solid #1890ff;
}

.period .age {
  font-weight: 600;
  color: #1890ff;
  min-width: 100px;
}

.period .phase {
  color: #595959;
}

/* Relationship Analysis */
.relationship-traits p,
.family-relationships p {
  line-height: 1.6;
  color: #595959;
  margin-bottom: 16px;
}

.partner-qualities {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quality {
  padding: 12px 16px;
  background: linear-gradient(90deg, #fff2e8 0%, #ffffff 100%);
  border-left: 3px solid #fa8c16;
  border-radius: 4px;
}

.quality strong {
  color: #262626;
}

.relationship-challenges ul {
  padding-left: 20px;
  line-height: 1.6;
}

.relationship-challenges li {
  margin-bottom: 8px;
  color: #595959;
}

/* Health Analysis */
.health-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.health-category {
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
}

.health-category h5 {
  margin: 0 0 12px 0;
  color: #531dab;
  font-weight: 600;
}

.health-category ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.health-category li {
  margin-bottom: 6px;
  color: #595959;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.recommendation {
  padding: 16px;
  background: linear-gradient(135deg, #e6fffb 0%, #ffffff 100%);
  border-radius: 8px;
  border-left: 3px solid #13c2c2;
}

.recommendation strong {
  color: #262626;
  display: block;
  margin-bottom: 4px;
}

.health-disclaimer {
  margin-top: 20px;
  padding: 16px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 6px;
}

.health-disclaimer em {
  color: #d46b08;
  font-style: normal;
}

/* Wealth Analysis */
.strength-areas,
.strategies {
  margin-top: 16px;
}

.strength,
.strategy-category {
  margin-bottom: 16px;
}

.strategy-category h5 {
  margin: 0 0 8px 0;
  color: #531dab;
  font-weight: 600;
}

.strategy-category ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.timing-periods {
  margin-top: 16px;
  space-y: 12px;
}

.timing-periods .period {
  background: #f6ffed;
  border-left-color: #52c41a;
}

.timing-periods .phase {
  font-weight: 600;
  color: #52c41a;
  min-width: 140px;
}

.timing-periods .focus {
  color: #595959;
}

.financial-cautions ul {
  padding-left: 20px;
  line-height: 1.6;
}

/* Fortune Analysis */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.theme {
  padding: 16px;
  background: linear-gradient(135deg, #f9f0ff 0%, #ffffff 100%);
  border-radius: 8px;
  border-left: 4px solid #722ed1;
}

.theme strong {
  color: #262626;
  display: block;
  margin-bottom: 4px;
}

/* Palaces Analysis */
.palaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.palace-item {
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
  border-top: 3px solid #531dab;
}

.palace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.palace-header h5 {
  margin: 0;
  color: #262626;
  font-weight: 600;
}

.chinese-name {
  font-size: 12px;
  color: #8c8c8c;
  font-style: italic;
}

.palace-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.star-tag {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
}

.star-tag.star-major {
  background: #531dab;
}

.star-tag.star-auxiliary {
  background: #1890ff;
}

.star-tag.star-minor {
  background: #52c41a;
}

.palace-interpretation {
  font-size: 14px;
  line-height: 1.5;
  color: #595959;
}

/* Stars Analysis */
.star-analysis-item {
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 4px solid #531dab;
}

.star-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.star-header h5 {
  margin: 0;
  color: #262626;
  font-weight: 600;
}

.star-palace {
  font-size: 12px;
  color: #8c8c8c;
  font-style: italic;
}

.star-meaning p {
  margin: 8px 0;
  line-height: 1.5;
  font-size: 14px;
}

.star-meaning strong {
  color: #262626;
}

/* Timing Analysis */
.current-period-info {
  padding: 20px;
  background: linear-gradient(135deg, #e6f7ff 0%, #ffffff 100%);
  border-radius: 8px;
  border-left: 4px solid #1890ff;
  margin-top: 16px;
}

.current-period-info p {
  margin: 8px 0;
  color: #595959;
}

.current-period-info strong {
  color: #262626;
}

.periods-timeline {
  margin-top: 20px;
  space-y: 16px;
}

.period-item {
  padding: 16px 20px;
  background: #fafafa;
  border-radius: 8px;
  border-left: 4px solid #d9d9d9;
  transition: all 0.3s ease;
}

.period-item.current-period {
  background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%);
  border-left-color: #52c41a;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.15);
}

.period-age {
  font-weight: 600;
  color: #262626;
  font-size: 14px;
}

.period-name {
  font-weight: 600;
  color: #531dab;
  margin: 4px 0;
}

.period-focus,
.period-opportunities {
  font-size: 14px;
  color: #595959;
  line-height: 1.4;
  margin: 2px 0;
}

/* Footer */
.interpretation-footer {
  padding: 24px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
}

.educational-notice p {
  margin: 0;
  font-size: 14px;
  color: #8c8c8c;
  line-height: 1.5;
  text-align: center;
}

.educational-notice strong {
  color: #595959;
}

/* Error State */
.interpretation-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: #8c8c8c;
}

.interpretation-error .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.interpretation-error .error-message {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #595959;
}

.interpretation-error .error-subtitle {
  font-size: 14px;
  color: #8c8c8c;
}

/* Responsive Design */
@media (max-width: 768px) {
  .interpretation-header {
    padding: 24px 16px 20px 16px;
  }

  .interpretation-header h2 {
    font-size: 24px;
  }

  .interpretation-subtitle {
    font-size: 14px;
  }

  .section-header {
    padding: 16px;
  }

  .section-title {
    font-size: 18px;
  }

  .section-content {
    padding: 16px;
  }

  .overview-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .traits-grid,
  .career-categories,
  .health-categories,
  .recommendations-grid,
  .themes-grid,
  .palaces-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .period {
    flex-direction: column;
  }

  .period .age {
    min-width: auto;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .interpretation-header {
    padding: 20px 12px 16px 12px;
  }

  .interpretation-header h2 {
    font-size: 22px;
  }

  .section-header {
    padding: 12px;
  }

  .section-title {
    font-size: 16px;
  }

  .section-content {
    padding: 12px;
  }

  .interpretation-footer {
    padding: 16px 12px;
  }

  .educational-notice p {
    font-size: 13px;
  }
}

/* Print Styles */
@media print {
  .zwds-interpretation-wrapper {
    box-shadow: none;
  }

  .section-toggle {
    display: none;
  }

  .section-content {
    display: block !important;
  }

  .interpretation-section {
    page-break-inside: avoid;
  }
}
