/* Personal Notes Feature Styles */

/* Note button giờ nằm trong line-controls, không cần absolute position nữa */

.note-indicator {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.9rem;
  opacity: 0.75;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.line:hover .note-indicator,
.line.active .note-indicator {
  opacity: 0;
}

/* Note Modal */
.note-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

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

.note-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.note-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.note-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2933;
}

.note-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  color: #64748b;
  transition: color 0.2s ease;
  border-radius: 4px;
}

.note-modal-close:hover {
  color: #1f2933;
  background: rgba(0, 0, 0, 0.05);
}

.note-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.note-sentence-preview {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.note-sentence-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.note-sentence-text {
  font-size: 1rem;
  color: #1f2933;
  line-height: 1.6;
}

.note-textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.note-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.note-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}

.note-btn-save,
.note-btn-delete,
.note-btn-cancel {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.note-btn-save {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.note-btn-save:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.note-btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.note-btn-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.note-btn-cancel {
  background: #f1f5f9;
  color: #475569;
}

.note-btn-cancel:hover {
  background: #e2e8f0;
  color: #1f2933;
}

/* Dark mode support */
body.theme-dark .note-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

body.theme-dark .note-btn:hover {
  background: rgba(30, 41, 59, 1);
}

body.theme-dark .note-btn.has-note {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

body.theme-dark .note-modal-content {
  background: #1e293b;
  color: #f1f5f9;
}

body.theme-dark .note-modal-header {
  border-bottom-color: #334155;
}

body.theme-dark .note-modal-header h3 {
  color: #f1f5f9;
}

body.theme-dark .note-modal-close {
  color: #94a3b8;
}

body.theme-dark .note-modal-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .note-sentence-preview {
  background: #0f172a;
  border-left-color: #3b82f6;
}

body.theme-dark .note-sentence-text {
  color: #f1f5f9;
}

body.theme-dark .note-textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.theme-dark .note-textarea:focus {
  border-color: #3b82f6;
}

body.theme-dark .note-modal-footer {
  border-top-color: #334155;
}

body.theme-dark .note-btn-cancel {
  background: #334155;
  color: #cbd5e1;
}

body.theme-dark .note-btn-cancel:hover {
  background: #475569;
  color: #f1f5f9;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .note-btn {
    right: 72px; /* Điều chỉnh cho mobile */
    top: 4px;
    font-size: 1rem;
    min-width: 24px;
    min-height: 24px;
    padding: 3px 5px;
  }
  
  .note-indicator {
    bottom: 4px;
    right: 4px;
    font-size: 0.9rem;
  }

  .note-modal {
    padding: 10px;
  }

  .note-modal-content {
    max-width: 100%;
  }

  .note-modal-header,
  .note-modal-body,
  .note-modal-footer {
    padding: 16px;
  }

  .note-modal-footer {
    flex-direction: column;
  }

  .note-btn-save,
  .note-btn-delete,
  .note-btn-cancel {
    width: 100%;
  }
}

/* Đảm bảo sidebar-section hiển thị trên mobile */
@media (max-width: 768px) {
  .sidebar-section {
    display: block !important;
  }
  
  .review-mode-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

