/* Word-Specific Styles */

/* Search Bar */
.search-bar {
  margin-bottom: 24px;
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-input::placeholder {
  color: #95a5a6;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper .search-input {
  width: 100%;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: #f0f7fd;
}

.suggestion-word {
  color: #2c3e50;
  font-weight: 500;
}

.suggestion-pos {
  color: #7f8c8d;
  font-size: 12px;
}

/* Pagination */
.series-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.series-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #3498db;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s, border-color 0.2s;
}

.series-nav a:hover:not([aria-disabled="true"]) {
  background-color: #f0f7fd;
  border-color: #3498db;
}

.series-nav a[aria-current="page"] {
  background-color: #3498db;
  border-color: #3498db;
  color: white;
  cursor: default;
}

.series-nav a[aria-disabled="true"]:not([aria-current="page"]) {
  color: #95a5a6;
  cursor: default;
}

/* Word Card Content (used in index grid) */
.word-title {
  margin: 0;
  font-size: 24px;
  color: #2c3e50;
}

.part-of-speech {
  font-size: 16px;
  color: #7f8c8d;
  font-weight: normal;
}

.sense-count-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #3498db;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.pronunciation {
  color: #95a5a6;
  font-style: italic;
  margin: 8px 0;
  font-size: 14px;
}

.definition {
  color: #34495e;
  line-height: 1.5;
  margin: 12px 0;
}

/* Word Show Page */
.word-show {
  max-width: 800px;
  margin: 0 auto;
}

/* Sense Card */
.sense-card {
  margin-bottom: 24px;
}

.sense-card-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ecf0f1;
  text-align: right;
}

.sense-section {
  margin: 20px 0;
}

.sense-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

/* Hero Section */
.word-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word-hero-title {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
}

.word-hero-pos {
  font-size: 18px;
  font-weight: normal;
  opacity: 0.9;
}

.word-hero-pronunciation {
  font-size: 16px;
  font-style: italic;
  opacity: 0.9;
  margin: 8px 0 0 0;
}

.pronunciation-audio-btn {
  background: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 26px;
  height: 26px;
  margin-left: 8px;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #667eea;
  transition: box-shadow 0.2s, transform 0.1s;
}

.pronunciation-audio-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: scale(1.1);
}

.pronunciation-audio-btn:active {
  transform: scale(0.95);
}

.word-hero-meta {
  font-size: 14px;
  opacity: 0.8;
  margin: 10px 0 0 0;
}

/* Context Section */
.context-quote {
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 15px 20px;
  margin: 0 0 15px 0;
  font-style: italic;
  color: #2c3e50;
}

.context-analysis {
  margin-top: 15px;
  color: #7f8c8d;
  font-size: 15px;
}

/* Example Sentences */
.example-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.example-list li {
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
  color: #34495e;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

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

.example-audio-btn {
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 50%;
  cursor: pointer;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 2px;
}

.example-audio-btn:hover {
  background: rgba(52, 152, 219, 0.2);
  border-color: rgba(52, 152, 219, 0.5);
  transform: scale(1.1);
}

.example-audio-btn:active {
  transform: scale(0.95);
}

.example-audio-btn.loading {
  opacity: 0.6;
  cursor: wait;
  font-size: 0;
}

.example-audio-btn.loading::after {
  content: "⏳";
  font-size: 10px;
}

/* Footer */
.word-footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
  margin-top: 20px;
}

.word-footer .text-meta {
  font-size: 14px;
  margin: 0;
}

/* Form Page (extends generic form styles) */
.form-page {
  max-width: 700px;
  margin: 0 auto;
}

/* Word Info Card (Read-only) */
.word-info-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 16px;
  color: #2c3e50;
}

.word-info-card strong {
  color: #34495e;
}

/* Form Errors */
.form-errors {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #721c24;
}

.form-errors h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.form-errors ul {
  margin: 0;
  padding-left: 20px;
}

.form-errors li {
  margin: 4px 0;
}

/* Form Styles */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.form-header h1 {
  margin: 0;
  font-size: 28px;
  color: #2c3e50;
}

.word-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Form Sections */
.form-section {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-section-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 8px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input::placeholder {
  color: #95a5a6;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-help {
  display: block;
  margin-top: 6px;
  color: #7f8c8d;
  font-size: 13px;
  line-height: 1.4;
}

/* Form Actions */
.form-actions {
  text-align: center;
  padding: 10px 0;
}

.btn-submit {
  background-color: #3498db;
  color: white;
  padding: 14px 40px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-submit:hover {
  background-color: #2980b9;
}

/* NOTE: Shared flashcard/study styles are now in flashcards.css */

/* ==================== Word Study Page Specific Styles ==================== */

/* Word-specific definitions in flashcard back */
.flashcard-back .definitions {
  flex: 1;
}

.definition-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.definition-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.definition-item h4 {
  font-size: 16px;
  font-weight: 600;
  color: #3498db;
  margin: 0 0 8px 0;
}

.definition-text {
  font-size: 16px;
  color: #2c3e50;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.examples {
  margin-top: 12px;
}

.examples strong {
  font-size: 14px;
  color: #7f8c8d;
  display: block;
  margin-bottom: 8px;
}

.examples ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.examples li {
  padding: 8px 0;
  color: #34495e;
  font-size: 15px;
  line-height: 1.5;
}

.examples li .example-audio-btn {
  background: #3498db;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: white;
  transition: box-shadow 0.2s, transform 0.1s;
}

.examples li .example-audio-btn:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transform: scale(1.1);
}

.examples li .example-audio-btn:active {
  transform: scale(0.95);
}

/* Rating Buttons */
.rating-buttons {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
  text-align: center;
}

.rating-buttons h3 {
  font-size: 18px;
  color: #2c3e50;
  margin: 0 0 20px 0;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.rating-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rating-label {
  font-size: 16px;
  font-weight: 600;
}

.rating-description {
  font-size: 12px;
  color: #7f8c8d;
}

.rating-again {
  border-color: #e74c3c;
}

.rating-again:hover {
  background-color: #fee;
  border-color: #c0392b;
}

.rating-hard {
  border-color: #f39c12;
}

.rating-hard:hover {
  background-color: #fff3e0;
  border-color: #d68910;
}

.rating-good {
  border-color: #27ae60;
}

.rating-good:hover {
  background-color: #e8f5e9;
  border-color: #1e8449;
}

.rating-easy {
  border-color: #3498db;
}

.rating-easy:hover {
  background-color: #e3f2fd;
  border-color: #2980b9;
}

/* ==================== Statistics Page Styles ==================== */

.stats-container {
  max-width: 1000px;
  margin: 0 auto;
}

.stats-section {
  margin-bottom: 40px;
}

.stats-section h2 {
  font-size: 24px;
  color: #2c3e50;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #3498db;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Stat Card Color Variants for Review Breakdown */
.stat-card.rating-again {
  background-color: #fee;
  border-color: #e74c3c;
}

.stat-card.rating-again .stat-value {
  color: #c0392b;
}

.stat-card.rating-hard {
  background-color: #fff3e0;
  border-color: #f39c12;
}

.stat-card.rating-hard .stat-value {
  color: #d68910;
}

.stat-card.rating-good {
  background-color: #e8f5e9;
  border-color: #27ae60;
}

.stat-card.rating-good .stat-value {
  color: #1e8449;
}

.stat-card.rating-easy {
  background-color: #e3f2fd;
  border-color: #3498db;
}

.stat-card.rating-easy .stat-value {
  color: #2980b9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .study-stats {
    grid-template-columns: 1fr;
  }

  .rating-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .flashcard {
    padding: 24px;
    min-height: 300px;
  }

  .flashcard-front .word {
    font-size: 32px;
  }

  .flashcard-back .word {
    font-size: 28px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
