/* Grid Styles - Hexagram and Trigram Grid Layouts */

/* Hexagram Grid */
.hexagram-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
  background: var(--background-light);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hexagram-grid-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.hexagram-grid-item {
  width: 120px;
  height: 120px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-items: start;
  justify-items: center;
  gap: 0px;
  padding: 3px;
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.hexagram-grid-item:hover {
  background: var(--accent-blue);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.hexagram-grid-number {
  font-weight: 600;
  font-size: 0.92em;
  color: #000000;
  margin: 0;
  padding: 15px 0 0 0;
  line-height: 1;
  grid-row: 1;
  grid-column: 1;
}

.hexagram-grid-symbol {
  font-size: 2.3805em;
  margin: 0;
  padding: 0 0 5px 0;
  line-height: 0.9;
  grid-row: 2;
  grid-column: 1;
}

.hexagram-grid-binary {
  font-family: var(--font-mono);
  font-size: 0.7475em;
  opacity: 0.7;
  margin: 0;
  padding: 0;
}

.hexagram-grid-content {
  font-size: 0.805em;
  opacity: 0.85;
  max-width: 95%;
  white-space: normal;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
  line-height: 1.1;
  grid-row: 3;
  grid-column: 1;
  align-self: start;
  overflow: hidden;
}

/* Trigram Grid */
.trigram-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--background-light);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.trigram-display {
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  padding: 3px;
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.trigram-display:hover {
  background: var(--accent-gold);
  color: var(--text-dark);
  transform: scale(1.05);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.trigram-number {
  font-size: 0.945em;
  font-weight: 600;
  color: #000000;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.trigram-symbol {
  font-size: 2.31em;
  margin: 0;
  padding: 0;
  line-height: 0.9;
}

.trigram-binary {
  font-family: var(--font-mono);
  font-size: 0.7875em;
  opacity: 0.7;
  margin: 0;
  padding: 0;
}

.trigram-content {
  font-size: 0.84em;
  opacity: 0.85;
  max-width: 94%;
  white-space: normal;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

/* Placeholder Styles */
.hexagram-placeholder,
.trigram-placeholder {
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-style: italic;
}

/* Responsive Grid Adjustments */
@media (max-width: 768px) {
  .hexagram-grid-row {
    gap: 5px;
  }
  
  .hexagram-grid-item {
    width: 40px;
    height: 40px;
    font-size: 0.8em;
  }
  
  .hexagram-grid-number {
    font-size: 1em;
  }
  
  .hexagram-grid-name,
  .hexagram-grid-binary {
    display: none;
  }
  
  .trigram-grid {
    gap: 10px;
  }
  
  .trigram-display {
    width: 70px;
    height: 70px;
  }
  
  .trigram-symbol {
    font-size: 1.5em;
  }
  
  .trigram-binary {
    font-size: 0.7em;
  }
}