/* Line Controls - Repeat and Next buttons on each sentence */

.line-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  justify-content: flex-end;
  align-items: center; /* Align items vertically */
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-wrap: wrap;
}

.line:hover .line-controls,
.line.active .line-controls {
  opacity: 1;
}

.line-btn {
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #2563eb;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  white-space: nowrap;
}

.line-btn-furigana,
.line-btn-vi {
  min-width: 70px;
  font-size: 0.8rem;
  font-weight: 500;
}

.line-btn-star,
.line-btn-note,
.line-btn-preview {
  min-width: 36px;
  font-size: 1rem;
}

.line-btn-star.saved {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
}

.line-btn-note.has-note {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
}

.line-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.line-btn:active {
  transform: translateY(0);
}

.line-btn-repeat {
  /* Repeat icon */
}

.line-btn-next {
  /* Next icon */
}

.line-btn-loop {
  /* Loop icon */
}

.line-btn-loop.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.line-btn-furigana.active,
.line-btn-vi.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.25));
  border-color: #16a34a;
  border-width: 1px;
  color: #15803d;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 4px 8px;
  min-width: 60px;
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.3);
  transform: scale(0.95);
}

.line-btn-furigana:not(.active),
.line-btn-vi:not(.active) {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  color: #64748b;
  opacity: 0.7;
}

.line-btn-loop.active:hover {
  background: rgba(59, 130, 246, 0.3);
}

.line-btn-furigana.active:hover,
.line-btn-vi.active:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.35));
  border-color: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4);
  transform: scale(0.98);
}

.line-btn-furigana:not(.active):hover,
.line-btn-vi:not(.active):hover {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.6);
  opacity: 0.9;
}

body.theme-dark .line-btn-loop.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #60a5fa;
  color: #93c5fd;
}

body.theme-dark .line-btn-furigana.active,
body.theme-dark .line-btn-vi.active {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(34, 197, 94, 0.3));
  border-color: #4ade80;
  border-width: 1px;
  color: #86efac;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 4px 8px;
  min-width: 60px;
  box-shadow: 0 1px 4px rgba(74, 222, 128, 0.3);
  transform: scale(0.95);
}

body.theme-dark .line-btn-furigana:not(.active),
body.theme-dark .line-btn-vi:not(.active) {
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(100, 116, 139, 0.5);
  color: #94a3b8;
  opacity: 0.6;
}

/* Active line - more visible controls */
.line.active .line-controls {
  opacity: 1;
}

.line.active .line-btn {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 500;
}

/* Dark mode */
body.theme-dark .line-controls {
  border-top-color: rgba(148, 163, 184, 0.3);
}

body.theme-dark .line-btn {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

body.theme-dark .line-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
}

body.theme-dark .line.active .line-btn {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #93c5fd;
}

/* Mobile - always show controls */
@media (max-width: 768px) {
  .line-controls {
    opacity: 1;
  }
  
  .line-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    min-width: 40px;
    height: 36px;
  }
}

