/* Component Styles - Individual UI Component Styling */

/* Hexagram Composition - Large Stacked Trigrams */
.hexagram-composition-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  padding: 15px;
  background: #ecf0f1;
  border-radius: 8px;
  border: 1px solid #bdc3c7;
}

.upper-trigram-button, 
.lower-trigram-button {
  background: none;
  border: none;
  font-size: 96px;
  cursor: pointer;
  padding: 5px;
  margin: 0;
  line-height: 0.7;
  transition: all 0.3s ease;
  color: #2c3e50;
}

.upper-trigram-button:hover, 
.lower-trigram-button:hover {
  color: #f39c12;
  transform: scale(1.1);
  text-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}

.upper-trigram-button:focus, 
.lower-trigram-button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

.trigram-label {
  margin-top: 10px;
  font-weight: bold;
}

/* Hexagram Detail Content Sections */
.hexagram-detail-content {
  margin-top: 20px;
}

.hexagram-detail-content h3 {
  color: #2c3e50;
  border-bottom: 1px solid #bdc3c7;
  padding-bottom: 5px;
  margin-top: 25px;
}

.judgment-text,
.image-text {
  margin: 15px 0;
  line-height: 1.8;
}

/* Lines Section */
.lines-section {
  margin-top: 25px;
}

.line-item {
  display: flex;
  margin-bottom: 15px;
  padding: 10px;
  background: #ecf0f1;
  border-radius: 4px;
}

.line-number {
  font-weight: bold;
  margin-right: 15px;
  min-width: 30px;
}

/* Trigram Detail Content */
.trigram-detail-content {
  text-align: center;
}

.trigram-symbol-large {
  font-size: 4em;
  margin: 20px 0;
}

.trigram-binary-large {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2em;
  opacity: 0.7;
}

/* Error Messages */
.error {
  color: #e74c3c;
  text-align: center;
  padding: 20px;
  background: #fadbd8;
  border-radius: 4px;
  margin: 10px 0;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #3498db;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Source Selector Styles */
.source-selector-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 10px;
}

.source-selector-section label {
  font-weight: 500;
  margin-bottom: 5px;
  color: #2c3e50;
}

#source-selector {
  padding: 8px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  background-color: white;
  font-size: 0.9rem;
  color: #2c3e50;
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.3s ease;
}

#source-selector:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#source-selector:hover {
  border-color: #3498db;
}

/* Header Content Layout */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* Add Source Modal Styles */
.add-source-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.add-source-form h3 {
  margin: 0;
  color: #2c3e50;
  text-align: center;
}

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

.form-group label {
  font-weight: 500;
  color: #2c3e50;
}

.form-group input,
.form-group select {
  padding: 10px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.primary-button,
.secondary-button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-button {
  background-color: #3498db;
  color: white;
}

.primary-button:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
}

.secondary-button {
  background-color: #ecf0f1;
  color: #2c3e50;
}

.secondary-button:hover {
  background-color: #bdc3c7;
  transform: translateY(-1px);
}

/* Interactive Elements */
.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

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


/* Reading Component Styles */

/* Reading Thrower Buttons */
#line-thrower .line-button {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Reading Display Elements */
.reading-hexagram .hexagram-title {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.reading-hexagram .hexagram-number {
  font-weight: bold;
  color: #7f8c8d;
  margin-bottom: 0.5rem;
}

.reading-hexagram .hexagram-line {
  margin: 0.25rem 0;
  position: relative;
}

.reading-hexagram .hexagram-line.moving-line {
  background: rgba(243, 156, 18, 0.1);
  border-radius: 4px;
  padding: 0.1rem;
}

.reading-hexagram .solid-line {
  height: 24px;
  background: #2c3e50;
  border-radius: 2px;
}

.reading-hexagram .broken-line-left,
.reading-hexagram .broken-line-right {
  display: inline-block;
  width: 40%;
  height: 24px;
  background: #2c3e50;
  border-radius: 2px;
}

.reading-hexagram .broken-line-left {
  margin-right: 20%;
}

.reading-hexagram .moving-line-indicator {
  font-size: 0.7rem;
  color: #f39c12;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-top: 0.1rem;
}

.reading-hexagram .hexagram-trigrams {
  margin-top: 1rem;
}

.reading-hexagram .upper-trigram,
.reading-hexagram .lower-trigram {
  font-size: 1.5rem;
  margin: 0.25rem 0;
}