/**
 * legislationModal.css — Styles for the legislation viewer modal
 */

.legislation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legislation-modal.hidden {
  display: none;
}

.legislation-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.legislation-modal-container {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Dark mode */
[data-theme="dark"] .legislation-modal-container {
  background: #1e1e1e;
  color: #fff;
}

.legislation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  flex-shrink: 0;
}

[data-theme="dark"] .legislation-modal-header {
  background: #2d2d2d;
  border-color: #444;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-bill-number {
  background: #e3f2fd;
  color: #1565c0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

[data-theme="dark"] .modal-bill-number {
  background: #1565c0;
  color: #fff;
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-search {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 8px;
}

[data-theme="dark"] .modal-search {
  background: #333;
  border-color: #555;
}

.modal-search input {
  border: none;
  outline: none;
  padding: 4px 8px;
  width: 180px;
  font-size: 0.9rem;
  background: transparent;
}

[data-theme="dark"] .modal-search input {
  color: #fff;
}
[data-theme="dark"] .modal-search input::placeholder {
  color: #999;
}

.modal-search button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: #666;
  font-size: 0.75rem;
}

.modal-search button:hover {
  color: #1976d2;
}

.modal-search-count {
  font-size: 0.8rem;
  color: #666;
  min-width: 50px;
  text-align: center;
}

.modal-external-link {
  color: #1976d2;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.2rem;
}

.modal-external-link:hover {
  background: #e3f2fd;
}

.modal-external-link.hidden {
  display: none;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
}

.modal-close:hover {
  background: #ffebee;
  color: #c62828;
}

.legislation-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.modal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f5f5f5;
  padding: 20px 40px;
  border-radius: 8px;
  color: #666;
  z-index: 1;
}

.modal-loading.hidden {
  display: none;
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.modal-iframe.loading {
  opacity: 0.3;
}

.legislation-modal-footer {
  padding: 10px 20px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  font-size: 0.85rem;
  color: #666;
  flex-shrink: 0;
}

[data-theme="dark"] .legislation-modal-footer {
  background: #2d2d2d;
  border-color: #444;
  color: #aaa;
}

.modal-citation {
  font-style: italic;
}

/* Clickable cells in the regulations table */
.has-legislation-link {
  position: relative;
}

.has-legislation-link:hover {
  background: #e3f2fd !important;
}

[data-theme="dark"] .has-legislation-link:hover {
  background: #1e3a5f !important;
}

.legislation-link-icon {
  margin-left: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .legislation-modal-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .modal-search input {
    width: 120px;
  }
  
  .modal-title {
    font-size: 1rem;
  }
}
