/* === Homework System Styles === */

/* Tab bar (used in student.html) */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.tab-bar .tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-bar .tab.active {
  color: var(--primary);
}

.tab-bar .tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Homework card */
.hw-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 14px 18px;
  margin-bottom: 12px;
  border-left: 4px solid var(--text-muted);
  cursor: pointer;
  transition: transform 0.1s;
}

.hw-card:active {
  transform: scale(0.98);
}

.hw-card.status-pending {
  border-left-color: #FF9500;
}

.hw-card.status-submitted {
  border-left-color: #007AFF;
}

.hw-card.status-reviewed {
  border-left-color: #34C759;
}

.hw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hw-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.hw-card-tone {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hw-card-focus {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hw-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Status badges */
.hw-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  flex-shrink: 0;
}

.hw-badge.pending {
  background: #FFF3E0;
  color: #E65100;
}

.hw-badge.submitted {
  background: #E3F2FD;
  color: #1565C0;
}

.hw-badge.reviewed {
  background: #E8F5E9;
  color: #2E7D32;
}

/* Review section (inline in student cards + teacher review) */
.hw-review {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.hw-review-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hw-review-comment {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* Star rating (CSS-only with radio buttons) */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 1.4rem;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.star-rating label::before {
  content: '\2605';
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #FFB800;
}

.star-rating-display {
  display: inline-flex;
  gap: 1px;
  font-size: 0.9rem;
}

.star-rating-display .star {
  color: var(--border);
}

.star-rating-display .star.filled {
  color: #FFB800;
}

/* Homework banner (in player.html) */
.hw-banner {
  display: none;
  background: linear-gradient(135deg, #FFF8E1, #FFF3E0);
  border-bottom: 1px solid #FFE0B2;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.hw-banner.visible {
  display: block;
}

.hw-banner-title {
  font-weight: 600;
  color: #E65100;
  margin-bottom: 2px;
  font-size: 0.8rem;
}

.hw-banner-focus {
  color: #BF360C;
  line-height: 1.4;
}

.hw-banner-deadline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Assignment form (homework-manage.html) */
.hw-form {
  padding: 16px;
}

.hw-form-group {
  margin-bottom: 18px;
}

.hw-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hw-form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

.hw-form-input:focus {
  border-color: var(--primary-light);
}

textarea.hw-form-input {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

.hw-form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

/* Song search results */
.song-results {
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.song-results.visible {
  display: block;
}

.song-results li {
  padding: 10px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.song-results li:last-child {
  border-bottom: none;
}

.song-results li:active {
  background: var(--bg);
}

.selected-song {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F3F0FF;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.selected-song .remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Tone chips in form */
.tone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Speed radio buttons */
.speed-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.speed-option {
  display: none;
}

.speed-option + label {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.speed-option:checked + label {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Submit button (full width) */
.hw-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.hw-submit-btn:active {
  transform: scale(0.98);
}

.hw-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Teacher review expandable */
.hw-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.hw-card.expanded .hw-expand {
  max-height: 500px;
}

.hw-expand-inner {
  padding-top: 12px;
}

.hw-expand-inner audio {
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
}

.hw-review-submit {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  background: #34C759;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.hw-review-submit:active {
  transform: scale(0.98);
}

/* Success message */
.hw-success {
  text-align: center;
  padding: 40px 20px;
}

.hw-success .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.hw-success h3 {
  margin-bottom: 8px;
}

.hw-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Manage page tabs */
.manage-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.manage-tabs .tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.manage-tabs .tab.active {
  color: var(--primary);
}

.manage-tabs .tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* Manage page content container */
.manage-content {
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}
