/* GD&T Guide Mode Styles */

.gdt-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
}

.gdt-section {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.gdt-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.gdt-description {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Filters */
.gdt-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 500;
  color: var(--foreground);
  font-size: 0.875rem;
}

.gdt-select,
.gdt-input {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--input-background);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.gdt-select:focus,
.gdt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-alpha);
}

.search-group {
  grid-column: span 2;
}

/* Actions */
.gdt-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gdt-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--button-background);
  color: var(--button-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.gdt-button:hover {
  background: var(--button-hover-background);
  border-color: var(--button-hover-border);
}

.gdt-button.primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.gdt-button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.gdt-button.secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--secondary);
}

.gdt-button.secondary:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
}

/* Stats */
.gdt-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Table */
.gdt-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gdt-table th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.gdt-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.gdt-table th.sortable:hover {
  background: var(--muted-hover);
}

.sort-icon {
  margin-left: 0.5rem;
  opacity: 0.6;
  font-size: 0.75rem;
}

.gdt-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  font-size: 0.875rem;
}

.gdt-table tr:hover {
  background: var(--muted-alpha);
}

/* Symbol Display */
.symbol-cell {
  min-width: 120px;
}

.symbol-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.symbol-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--card-background);
  padding: 0.25rem;
}

.symbol-unicode {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--foreground);
  background: var(--muted);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.symbol-name {
  font-weight: 600;
  color: var(--foreground);
  text-align: center;
  font-size: 0.875rem;
}

/* Content Cells */
.description-cell {
  max-width: 200px;
  line-height: 1.4;
}

.definition-cell {
  max-width: 250px;
  line-height: 1.4;
}

.application-cell {
  max-width: 200px;
  line-height: 1.4;
}

.measurement-cell {
  max-width: 200px;
  line-height: 1.4;
}

.examples-cell {
  max-width: 200px;
}

.examples-list {
  margin: 0;
  padding-left: 1rem;
  line-height: 1.4;
}

.examples-list li {
  margin-bottom: 0.25rem;
}

/* Actions */
.actions-cell {
  width: 100px;
  text-align: center;
}

.gdt-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin: 0.125rem;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease;
  font-size: 1rem;
}

.gdt-action-btn:hover {
  background: var(--muted);
}

.favorite-btn {
  color: var(--warning);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.gdt-detail-modal {
  background: var(--card, var(--card-background));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--muted);
}

.modal-header h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.25rem;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background: var(--muted-hover);
}

.modal-body {
  padding: 1.5rem;
  background: var(--card, var(--card-background));
  color: var(--foreground);
}

/* Theme-aware modal background fix */
[data-theme="light"] .gdt-detail-modal {
  background: var(--card);
  border-color: var(--border);
}

[data-theme="dark"] .gdt-detail-modal {
  background: var(--card);
  border-color: var(--border);
}

[data-theme="light"] .modal-header,
[data-theme="dark"] .modal-header {
  background: var(--bg-secondary);
}

[data-theme="light"] .modal-body,
[data-theme="dark"] .modal-body {
  background: var(--card);
}

.symbol-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.symbol-display-large {
  display: flex;
  align-items: center;
  justify-content: center;
}

.symbol-image-large {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--card-background);
  padding: 0.5rem;
}

.symbol-unicode-large {
  font-size: 3rem;
  font-weight: bold;
  color: var(--foreground);
  background: var(--muted);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
}

.symbol-info h3 {
  margin: 0 0 0.5rem 0;
  color: var(--foreground);
  font-size: 1.25rem;
  background: var(--primary-alpha);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--primary);
}

.symbol-category {
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
}

.symbol-description {
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

.detail-sections {
  display: grid;
  gap: 1.5rem;
}

.detail-section h4 {
  margin: 0 0 0.75rem 0;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 600;
  background: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  border-bottom: 2px solid var(--primary);
}

.detail-section p,
.detail-section ul {
  margin: 0;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--muted-alpha);
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.detail-section ul {
  padding-left: 1.25rem;
}

.detail-section li {
  margin-bottom: 0.5rem;
}

/* Favorites Message */
.favorites-message {
  background: var(--primary-alpha);
  border: 1px solid var(--primary);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.message-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-content h4 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gdt-filters {
    grid-template-columns: 1fr;
  }
  
  .search-group {
    grid-column: span 1;
  }
  
  .gdt-actions {
    flex-direction: column;
  }
  
  .gdt-table {
    font-size: 0.75rem;
  }
  
  .gdt-table th,
  .gdt-table td {
    padding: 0.5rem;
  }
  
  .symbol-image {
    width: 30px;
    height: 30px;
  }
  
  .symbol-unicode {
    font-size: 1.25rem;
    padding: 0.25rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .symbol-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .message-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .gdt-container {
    padding: 0.5rem;
  }
  
  .gdt-section {
    padding: 1rem;
  }
  
  .gdt-table {
    display: block;
    overflow-x: auto;
  }
  
  .gdt-table th,
  .gdt-table td {
    min-width: 120px;
  }
}
