/* Homework Assignment Modal Styles */

.homework-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.homework-modal-overlay.active {
  display: flex;
}

.homework-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: hwModalSlideIn 0.3s ease-out;
}

@keyframes hwModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.homework-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.homework-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.homework-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s;
}

.homework-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.homework-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.homework-modal-section {
  margin-bottom: 1.5rem;
}

.homework-modal-section:last-child {
  margin-bottom: 0;
}

.homework-modal-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.homework-modal-input,
.homework-modal-textarea,
.homework-modal-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s;
}

.homework-modal-input:focus,
.homework-modal-textarea:focus,
.homework-modal-select:focus {
  outline: none;
  border-color: #19777e;
  box-shadow: 0 0 0 3px rgba(25, 119, 126, 0.1);
}

.homework-modal-textarea {
  resize: vertical;
  min-height: 80px;
}

.homework-modal-search-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
}

.homework-modal-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.homework-modal-search-input:focus {
  outline: none;
  border-color: #19777e;
  box-shadow: 0 0 0 3px rgba(25, 119, 126, 0.1);
}

.homework-modal-results {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
}

.homework-modal-result-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.homework-modal-result-item:last-child {
  border-bottom: none;
}

.homework-modal-result-item:hover {
  background: #f3f4f6;
}

.homework-modal-result-item.selected {
  background: #e0f2f1;
  border-left: 3px solid #19777e;
}

.homework-modal-result-content {
  flex: 1;
  min-width: 0;
}

.homework-modal-result-preview-btn {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.homework-modal-result-preview-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #111827;
}

.homework-modal-result-title {
  font-weight: 500;
  font-size: 0.9375rem;
  color: #111827;
  margin-bottom: 0.25rem;
}

.homework-modal-result-meta {
  font-size: 0.8125rem;
  color: #6b7280;
}

.homework-modal-result-path {
  font-size: 0.75rem;
  color: #9ca3af;
  font-family: 'Courier New', monospace;
  margin-top: 0.25rem;
}

.homework-modal-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9375rem;
}

.homework-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.homework-modal-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.homework-modal-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.homework-modal-btn-cancel:hover {
  background: #e5e7eb;
}

.homework-modal-btn-primary {
  background: #19777e;
  color: white;
}

.homework-modal-btn-primary:hover {
  background: #155a62;
}

.homework-modal-btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.homework-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .homework-modal-grid {
    grid-template-columns: 1fr;
  }
}

.homework-modal-helper {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.375rem;
}

.homework-modal-filter-btn {
  padding: 0.375rem 0.875rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.homework-modal-filter-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.homework-modal-filter-btn.active {
  background: #1f2937;
  color: white;
  border-color: #1f2937;
}

.homework-modal-selected-list {
  background: #e0f2f1;
  border: 1px solid #19777e;
  border-radius: 6px;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
}

.homework-modal-selected-title {
  font-weight: 500;
  font-size: 0.9375rem;
  color: #111827;
  margin-bottom: 0.25rem;
}

.homework-modal-selected-meta {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Preview Modal Styles */
.homework-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.homework-preview-overlay.active {
  display: flex;
}

.homework-preview-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: hwPreviewSlideIn 0.25s ease-out;
}

@keyframes hwPreviewSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.homework-preview-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.homework-preview-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.homework-preview-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s;
}

.homework-preview-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.homework-preview-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.homework-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.homework-preview-list li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9375rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.homework-preview-list li:last-child {
  border-bottom: none;
}

.homework-preview-list li:nth-child(odd) {
  background: #f9fafb;
}

.homework-preview-number {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.8125rem;
  min-width: 2rem;
}

.homework-preview-content {
  flex: 1;
}

.homework-preview-sentence {
  margin-bottom: 0.25rem;
  color: #111827;
}

.homework-preview-translation {
  font-size: 0.8125rem;
  color: #6b7280;
  font-style: italic;
}

.homework-preview-empty {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.homework-preview-loading {
  text-align: center;
  padding: 2rem;
  color: #19777e;
  font-weight: 500;
}

.homework-preview-error {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
  font-weight: 500;
}

.homework-preview-word {
  margin-bottom: 0.25rem;
}

.homework-preview-def {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.25rem;
  padding-left: 1rem;
}
