/* Additional CSS for vocabulary management */

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #7f8c8d;
  grid-column: 1 / -1;
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* Badge Styles */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-beginner {
  background-color: #d4edda;
  color: #155724;
}

.badge-intermediate {
  background-color: #fff3cd;
  color: #856404;
}

.badge-advanced {
  background-color: #f8d7da;
  color: #721c24;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
}

.badge-secondary {
  background-color: #e2e3e5;
  color: #383d41;
}

.text-muted {
  color: #6c757d !important;
  font-size: 0.875rem;
} /* Vocabulary Set Card Enhancements */
.vocab-set-card {
  position: relative;
  overflow: hidden;
}

.vocab-set-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #3498db, #2c3e50);
}

.vocab-set-title i {
  margin-right: 0.5rem;
  color: #3498db;
}

.vocab-set-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.vocab-set-meta i {
  font-size: 0.8rem;
}

/* Words Table Enhancements */
.words-table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.words-table th {
  position: sticky;
  top: 0;
  z-index: 10;
}

.words-table td {
  vertical-align: middle;
}

.words-table tr:last-child td {
  border-bottom: none;
}

/* Form Enhancements */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
  font-family: inherit;
}

/* Modal Enhancements */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
  padding-right: 2rem;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn-group .btn {
  margin: 0;
}

/* Action Buttons */
.word-actions .btn {
  padding: 0.4rem 0.6rem;
}

/* Keep edit/delete buttons on a single line */
.word-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.vocab-set-actions .btn {
  padding: 0.5rem 0.8rem;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .vocab-set-card {
    margin-bottom: 1rem;
  }

  .vocab-set-header {
    flex-direction: column;
    gap: 1rem;
  }

  .vocab-set-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .words-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .words-table th,
  .words-table td {
    padding: 0.5rem;
    min-width: 120px;
  }

  .management-actions {
    flex-direction: column;
    width: 100%;
  }

  .words-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 200px;
  border-radius: 10px;
}

.skeleton-row {
  height: 20px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Hover Effects */
.vocab-set-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.words-table tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Animation for new elements */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success/Error States */
.success-message {
  color: #27ae60;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.error-message {
  color: #e74c3c;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

/* Progress indicators */
.vocab-set-progress {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.progress-item {
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.progress-item.learned {
  background-color: #d4edda;
  color: #155724;
}

.progress-item.not-learned {
  background-color: #fff3cd;
  color: #856404;
}

/* ===============================
   MANAGEMENT RESPONSIVE DESIGN 
   =============================== */

/* Tablet Styles */
@media (max-width: 1024px) {
  .modal-content {
    width: 90%;
    max-width: 600px;
  }

  .modal-large {
    width: 95%;
    max-width: 800px;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Modal Mobile */
  .modal-content {
    width: 95%;
    margin: 2rem auto;
    padding: 1rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }

  .modal-large {
    width: 95%;
    margin: 1rem auto;
    padding: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .modal-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .modal-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Form Mobile */
  .form-row {
    flex-direction: column;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Empty State Mobile */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state h3 {
    font-size: 1.2rem;
  }

  /* Badge Mobile */
  .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  /* Progress Mobile */
  .vocab-set-progress {
    justify-content: center;
  }

  .progress-item {
    font-size: 0.7rem;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .modal-content,
  .modal-large {
    width: 98%;
    margin: 0.5rem auto;
    padding: 0.8rem;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }

  .close {
    font-size: 1.5rem;
    padding: 0.25rem;
  }

  .empty-state {
    padding: 1.5rem 0.5rem;
  }

  .empty-state h3 {
    font-size: 1.1rem;
  }

  .empty-state p {
    font-size: 0.9rem;
  }
}

/* Vocabulary Statistics */
.vocabulary-stats {
  margin: 2rem 0;
  padding: 1.5rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #3498db;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  animation: slideInRight 0.6s ease-out;
  opacity: 0;
  animation-fill-mode: forwards;
}

.stat-card:nth-child(1) {
  animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.total {
  border-left-color: #3498db;
}

.stat-card.total .stat-icon {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.stat-card.learned {
  border-left-color: #27ae60;
}

.stat-card.learned .stat-icon {
  background: linear-gradient(135deg, #27ae60, #229954);
}

.stat-card.unlearned {
  border-left-color: #f39c12;
}

.stat-card.unlearned .stat-icon {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stat-card.progress {
  border-left-color: #9b59b6;
}

.stat-card.progress .stat-icon {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: white;
  font-size: 1.5rem;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.stat-number:hover {
  color: #3498db;
  transform: scale(1.05);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.stat-number.updating {
  animation: pulse 0.6s ease-in-out;
}

.stat-label {
  font-size: 0.9rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive Statistics */
@media (max-width: 768px) {
  .vocabulary-stats {
    margin: 1rem 0;
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Learned toggle switch */
.learned-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e3e5;
  transition: 0.2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #2ecc71;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.learned-toggle .label {
  font-size: 0.85rem;
  color: #2c3e50;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-badge i {
  font-size: 0.85rem;
}

/* Bulk word processing */
.bulk-word-section {
  max-height: 70vh;
  overflow-y: auto;
}

.bulk-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.processed-words-container {
  margin-top: 1.5rem;
  border-top: 2px solid #ecf0f1;
  padding-top: 1.5rem;
}

.processed-word-item {
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #f8f9fa;
}

.word-item-header {
  padding: 1rem;
  background: white;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #e1e8ed;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.word-title {
  font-weight: 600;
  color: #2c3e50;
  flex: 1;
  margin: 0;
}

.word-item-details {
  padding: 1rem;
}

.bulk-submit-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* AI Combined Input */
.ai-combined-input {
  padding: 1rem;
}

.ai-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #e8f4fd;
  border-left: 4px solid #3498db;
  border-radius: 0 4px 4px 0;
}

.ai-info small {
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .bulk-actions {
    flex-direction: column;
  }

  .bulk-submit-actions {
    flex-direction: column;
  }

  .word-item-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* Form Mode Styles */
.individual-word-section,
.bulk-word-section {
  transition: all 0.3s ease;
}

.bulk-mode-toggle {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #dee2e6;
}

.bulk-mode-toggle p {
  margin-bottom: 1rem;
  color: #6c757d;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* Bulk Words Dynamic Form */
.bulk-words-container {
  margin-top: 1.5rem;
}

.bulk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

.bulk-header h4 {
  margin: 0;
  color: #2c3e50;
}

.bulk-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bulk-words-form {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  background-color: #f8f9fa;
}

.bulk-words-form::-webkit-scrollbar {
  width: 8px;
}

.bulk-words-form::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.bulk-words-form::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.bulk-words-form::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.bulk-word-row {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr 2.5fr 2fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bulk-word-row:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.bulk-word-row .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.bulk-word-row .form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.bulk-word-row input,
.bulk-word-row textarea,
.bulk-word-row select {
  font-size: 0.9rem;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
  width: 100%;
}

.bulk-word-row input:focus,
.bulk-word-row textarea:focus,
.bulk-word-row select:focus {
  border-color: #007bff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bulk-word-row textarea {
  resize: vertical;
  min-height: 2.75rem;
  max-height: 4rem;
}

.bulk-row-actions {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
  align-self: end;
  padding-bottom: 0.25rem;
  justify-content: flex-start;
}

.bulk-row-actions .btn {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  min-width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 1;
  white-space: nowrap;
}

.bulk-row-actions .btn i {
  font-size: 0.875rem;
}

.bulk-row-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.bulk-row-actions .btn-info:hover {
  background-color: #138496;
}

.bulk-row-actions .btn-danger:hover {
  background-color: #c82333;
}

.bulk-add-section {
  margin: 1rem 0;
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.bulk-add-section:hover {
  border-color: #007bff;
  background: #e7f3ff;
}

.bulk-add-section button {
  background: transparent;
  border: none;
  color: #6c757d;
  transition: color 0.3s ease;
}

.bulk-add-section:hover button {
  color: #007bff;
}

.bulk-add-section small.text-muted {
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
}

.bulk-add-section:hover small.text-muted {
  color: #495057;
}

.bulk-submit-section {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 2px solid #dee2e6;
}

.row-number {
  position: absolute;
  top: -12px;
  left: 15px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .bulk-add-section small.text-muted {
    font-size: 0.7rem;
  }
}

@media (max-width: 1024px) {
  .bulk-word-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .bulk-row-actions {
    flex-direction: row;
    justify-content: center;
    align-self: stretch;
    padding-bottom: 0;
    gap: 0.5rem;
  }

  .bulk-row-actions .btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
  }

  .bulk-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .bulk-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .bulk-words-form {
    padding: 1rem;
  }
}

/* Enhanced Dark Button Styles */
.btn-dark {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  border: none !important;
  color: white !important;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-dark:hover {
  background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
  color: white !important;
}

.btn-dark:hover::before {
  left: 100%;
}

.btn-dark:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(44, 62, 80, 0.3);
}

/* Edit Word Modal Styles */
#editWordModal .modal-content {
  max-width: 600px;
  width: 90%;
}

#editWordModal .modal-content h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#editWordModal .modal-content h2 i {
  color: #3498db;
}

#editWordModal .form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ecf0f1;
}

#editWordModal .form-actions .btn {
  min-width: 120px;
}

#editWordModal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  #editWordModal .form-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  #editWordModal .form-actions {
    flex-direction: column;
  }

  #editWordModal .form-actions .btn {
    width: 100%;
  }
}
