/* Greater Xuan Kong Professional Card Styles */

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

body {
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  color: #333;
}

#app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

.app-header h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Control Panel */
.control-panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.mountain-selector,
.period-selector {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.mountain-selector:focus,
.period-selector:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.yuan-controls,
.house-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.yuan-controls input[type="radio"],
.house-controls input[type="radio"] {
  margin-right: 5px;
}

.yuan-controls label,
.house-controls label {
  font-weight: normal;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.yuan-controls input[type="radio"]:checked + label,
.house-controls input[type="radio"]:checked + label {
  background: linear-gradient(45deg, #2a5298, #1e3c72);
  color: white;
  border-color: #2a5298;
}

.calculate-button,
.analyze-button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.calculate-button {
  background: linear-gradient(45deg, #2a5298, #1e3c72);
  color: white;
}

.analyze-button {
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
}

.calculate-button:hover,
.analyze-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 30px;
  margin-bottom: 30px;
}

/* Luopan Container */
.luopan-container {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#luopan-canvas {
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  height: auto;
}

.precision-indicator {
  background: rgba(42, 82, 152, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #2a5298;
  font-weight: 600;
}

/* Analysis Panel */
.analysis-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.analysis-section h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2rem;
  border-bottom: 2px solid #2a5298;
  padding-bottom: 5px;
}

/* Flying Star Grid */
.star-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.star-cell {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.star-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.star-number {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.star-quality {
  font-size: 0.9rem;
  font-weight: 600;
}

.ling-zheng-item,
.aixing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.ling-zheng-item:last-child,
.aixing-item:last-child {
  border-bottom: none;
}

.label {
  font-weight: 600;
  color: #555;
}

/* Mountains Panel */
.mountains-panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.mountains-panel h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
  border-bottom: 2px solid #2a5298;
  padding-bottom: 8px;
}

.current-hexagram,
.hexagram-meaning {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.mountains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.mountain-item {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.mountain-item:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.mountain-item.active {
  background: linear-gradient(45deg, #2a5298, #1e3c72);
  color: white;
  border-color: #2a5298;
}

/* Recommendations Panel */
.recommendations-panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.recommendations-panel h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
  border-bottom: 2px solid #28a745;
  padding-bottom: 8px;
}

.recommendation-category {
  margin-bottom: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #28a745;
}

.recommendation-category h4 {
  color: #28a745;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.recommendation-category div {
  line-height: 1.6;
  color: #666;
}

/* Legend */
.legend {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.legend h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1rem;
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

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

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.legend-color.excellent {
  background: #28a745;
}
.legend-color.good {
  background: #17a2b8;
}
.legend-color.declining {
  background: #ffc107;
}
.legend-color.harmful {
  background: #dc3545;
}
.legend-color.zheng-shen {
  background: linear-gradient(45deg, #28a745, #20c997);
}
.legend-color.ling-shen {
  background: linear-gradient(45deg, #17a2b8, #6f42c1);
}

/* Star Quality Colors */
.star-excellent {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}
.star-good {
  background: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
}
.star-declining {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}
.star-harmful {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}
.star-neutral {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* Responsive Design */
@media (max-width: 1400px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .analysis-panel {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    display: grid;
  }
}

@media (max-width: 768px) {
  #app-container {
    padding: 10px;
  }

  .control-panel {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .app-header h1 {
    font-size: 2.2rem;
  }

  #luopan-canvas {
    width: 500px;
    height: 500px;
  }

  .legend-items {
    grid-template-columns: 1fr;
  }

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

  .mountains-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Status Indicators */
.status-active {
  background: #28a745;
  color: white;
}
.status-inactive {
  background: #6c757d;
  color: white;
}
.status-warning {
  background: #ffc107;
  color: #333;
}
.status-danger {
  background: #dc3545;
  color: white;
}
