/* readings.css - I Ching Reading Component Styles */

/* Reading Section Layout */
.reading-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.reading-section h3 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 1px solid #bdc3c7;
  padding-bottom: 0.5rem;
}

/* Reading Thrower */
.reading-thrower {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #bdc3c7;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.thrower-question {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  font-size: 0.9rem;
}

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

.thrower-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
}

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

/* Line-by-Line Interface */
.line-by-line {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #bdc3c7;
}

.line-by-line.hidden {
  display: none;
}

.line-by-line h4 {
  margin-top: 0;
  color: #2c3e50;
}

#line-thrower {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


/* Reading Display */
.reading-display,
.single-reading-display {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #bdc3c7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transformation-arrow {
  font-size: 2rem;
  font-weight: bold;
  color: #3498db;
}

.reading-hexagram {
  text-align: center;
  min-width: 150px;
}

.hexagram-title {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

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

.hexagram-display {
  margin: 1rem 0;
}

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

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

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

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

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

.moving-line-indicator {
  font-size: 0.7rem;
  color: #f39c12;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

/* Reading Grid */
.reading-grid {
  margin-top: 1rem;
}

.reading-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #bdc3c7;
}

.reading-grid-header h3 {
  margin: 0;
  color: #2c3e50;
}

.reading-grid-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.reading-grid-empty {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
}

.reading-grid-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.reading-grid-empty .empty-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.reading-grid-empty .empty-subtext {
  font-size: 0.9rem;
}

/* Reading Summary */
.reading-summary {
  padding: 1rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #bdc3c7;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.reading-summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #3498db;
}

.reading-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.reading-date {
  font-size: 0.8rem;
  color: #7f8c8d;
}

.delete-reading {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.delete-reading:hover {
  background: #fadbd8;
  color: #c0392b;
}

.reading-question {
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-hexagrams {
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* Loading and Empty States */
.loading-reading,
.empty-reading,
.error-reading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.loading-message,
.empty-message {
  margin-top: 1rem;
  color: #7f8c8d;
  font-weight: 500;
}

.empty-instruction {
  margin-top: 0.5rem;
  color: #95a5a6;
  font-size: 0.9rem;
}

.error-message {
  color: #e74c3c;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .reading-display,
  .single-reading-display {
    flex-direction: column;
    gap: 1rem;
  }
  
  .transformation-arrow {
    transform: rotate(90deg);
  }
  
  .reading-grid-content {
    grid-template-columns: 1fr;
  }
  
  .thrower-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Ceremonial Line Display */
.line-display {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  text-align: left;
}

.line-display[data-value] {
  background: #e8f4fc;
  border-color: #3498db;
}

/* Complete Reading Button */
#complete-reading {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#complete-reading:hover:not(:disabled) {
  background: #219653;
  transform: translateY(-1px);
}

#complete-reading:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

/* Universal hidden class for dynamic element visibility */
.hidden {
  display: none !important;
}