/**
 * IoT Class Feedback & Progress Tracking Styles
 */

/* === FEEDBACK SECTION === */

.iotclass-feedback-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

.feedback-container h4 {
  margin: 0 0 1rem 0;
  color: #2C3E50;
  font-size: 1.1rem;
  text-align: center;
}

.feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.feedback-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

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

.feedback-btn.feedback-up:hover,
.feedback-btn.feedback-up.selected {
  border-color: #16A085;
  background: #e8f8f5;
}

.feedback-btn.feedback-down:hover,
.feedback-btn.feedback-down.selected {
  border-color: #E67E22;
  background: #fef5e7;
}

.feedback-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.feedback-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.feedback-label {
  font-size: 0.85rem;
  color: #666;
}

.feedback-comment-section {
  margin-top: 1rem;
}

.feedback-comment-section textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.feedback-comment-section textarea:focus {
  outline: none;
  border-color: #16A085;
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}

.feedback-submit-btn {
  background: #16A085;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.feedback-submit-btn:hover {
  background: #138D75;
}

.feedback-thanks {
  text-align: center;
  color: #16A085;
  font-weight: 500;
  padding: 1rem;
  background: #e8f8f5;
  border-radius: 8px;
}

/* === PROGRESS TRACKING (now at bottom of page) === */

.iotclass-progress-check {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.progress-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s;
}

.progress-checkbox-label:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.progress-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #16A085;
}

.progress-checkbox:checked + .progress-checkbox-text {
  color: #16A085;
  font-weight: 500;
}

.iotclass-progress-check.progress-saved .progress-checkbox-label {
  background: #e8f8f5;
  border-color: #16A085;
}

/* === ADMIN LINK === */

.iotclass-admin-link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.admin-link-btn,
.admin-logout-btn {
  font-size: 0.85rem;
  color: #666;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.admin-link-btn:hover {
  background: #f8f9fa;
  color: #2C3E50;
}

.admin-logout-btn:hover {
  background: #fee;
  color: #c00;
}

/* === ADMIN MODAL === */

.iotclass-admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.admin-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #2C3E50;
  color: white;
}

.admin-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.admin-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.admin-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.admin-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-card.stat-up {
  background: #e8f8f5;
}

.stat-card.stat-down {
  background: #fef5e7;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2C3E50;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
}

/* Feedback List */
.admin-feedback-list,
.admin-comments-list {
  margin-top: 1.5rem;
}

.admin-feedback-list h3,
.admin-comments-list h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #2C3E50;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.feedback-item,
.comment-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.feedback-item.up {
  border-left: 3px solid #16A085;
}

.feedback-item.down {
  border-left: 3px solid #E67E22;
}

.feedback-vote {
  font-size: 1.2rem;
}

.feedback-chapter,
.comment-chapter {
  font-weight: 500;
  color: #2C3E50;
}

.feedback-comment,
.comment-text {
  flex: 1;
  color: #666;
  font-style: italic;
}

.feedback-time,
.comment-time {
  font-size: 0.8rem;
  color: #999;
}

.comment-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #ffc107;
  color: #333;
  border-radius: 4px;
}

.comment-status.status-pending {
  background: #ffc107;
}

.comment-status.status-resolved {
  background: #28a745;
  color: white;
}

/* Error message */
.feedback-error {
  background: #f8d7da;
  color: #721c24;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  text-align: center;
}

/* Feedback actions row */
.feedback-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.feedback-cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.feedback-cancel-btn:hover {
  background: #5a6268;
}

/* Admin login form */
.admin-login-form {
  text-align: center;
}

.admin-login-form p {
  margin-bottom: 1rem;
  color: #666;
}

.admin-username-input,
.admin-password-input {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.admin-username-input:focus,
.admin-password-input:focus {
  outline: none;
  border-color: #16A085;
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}

.admin-login-actions {
  margin-top: 1rem;
}

.admin-login-submit {
  background: #16A085;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-login-submit:hover {
  background: #138D75;
}

.admin-login-submit:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* Admin error */
.admin-error {
  text-align: center;
  padding: 2rem;
  color: #721c24;
}

/* Empty message */
.empty-message {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Admin footer */
.admin-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  text-align: center;
  color: #999;
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
  .feedback-buttons {
    flex-direction: column;
    align-items: center;
  }

  .feedback-btn {
    width: 100%;
    max-width: 200px;
  }

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

  .admin-modal-content {
    max-height: 100vh;
    border-radius: 0;
  }
}

/* === SECTION-LEVEL FEEDBACK (Hover Popup System) === */

/* Trigger icon that appears on section headers */
.section-feedback-trigger {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  vertical-align: middle;
}

/* Show trigger on header hover */
h2:hover .section-feedback-trigger,
h3:hover .section-feedback-trigger,
h4:hover .section-feedback-trigger,
h5:hover .section-feedback-trigger,
.section-feedback-trigger:hover {
  opacity: 1;
}

.trigger-icon {
  font-size: 0.85em;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  transition: all 0.15s ease;
}

.trigger-icon:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.trigger-icon.trigger-done {
  background: #e8f8f5;
  border-color: #16A085;
  color: #16A085;
  opacity: 0.7;
}

/* Feedback popup panel */
.section-feedback-popup {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.5rem;
  z-index: 10000;
  min-width: 160px;
}

.popup-header {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid #eee;
}

.popup-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

.popup-btn {
  background: none;
  border: 1px solid transparent;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
}

.popup-btn:hover {
  background: #f0f0f0;
  border-color: #ddd;
  transform: scale(1.1);
}

.popup-up:hover {
  background: #e8f8f5;
  border-color: #16A085;
}

.popup-down:hover {
  background: #fef5e7;
  border-color: #E67E22;
}

.popup-star:hover {
  background: #fff8e1;
  border-color: #f9a825;
}

.popup-comment:hover {
  background: #e3f2fd;
  border-color: #2196f3;
}

/* Star rating popup */
.star-rating-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 1rem;
  z-index: 1000;
  min-width: 250px;
  margin-top: 0.5rem;
}

.star-rating-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid #dee2e6;
  border-top: 1px solid #dee2e6;
  transform: rotate(45deg);
}

.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.rating-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.rating-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #555;
}

.rating-label-icon {
  font-size: 1rem;
}

.star-rating {
  display: flex;
  gap: 0.15rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #ddd;
  transition: color 0.1s, transform 0.1s;
  padding: 0;
  line-height: 1;
}

.star-btn:hover {
  transform: scale(1.2);
}

.star-btn.active,
.star-btn:hover,
.star-rating:hover .star-btn {
  color: #f9a825;
}

.star-rating .star-btn:hover ~ .star-btn {
  color: #ddd;
}

.rating-submit-btn {
  width: 100%;
  background: #16A085;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.rating-submit-btn:hover {
  background: #138D75;
}

.rating-submit-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* Section comment modal */
.section-comment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.section-comment-modal {
  background: white;
  border-radius: 12px;
  max-width: 450px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.section-comment-modal h4 {
  margin: 0 0 0.5rem 0;
  color: #2C3E50;
  font-size: 1.1rem;
}

.section-comment-modal .section-name {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.section-comment-modal textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 1rem;
}

.section-comment-modal textarea:focus {
  outline: none;
  border-color: #E67E22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.section-comment-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.section-comment-cancel {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.section-comment-cancel:hover {
  background: #5a6268;
}

.section-comment-submit {
  background: #E67E22;
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.section-comment-submit:hover {
  background: #d35400;
}

.section-comment-submit:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

/* Vote count badges */
.vote-count {
  font-size: 0.75rem;
  color: #999;
  margin-left: -0.2rem;
}

/* Section feedback submitted state */
.section-feedback.submitted {
  opacity: 0.8;
}

.section-feedback.submitted .section-vote-btn,
.section-feedback.submitted .section-rate-btn {
  pointer-events: none;
}

/* === CHAPTER RATING GRID === */

.chapter-rating-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.chapter-rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.chapter-rating-item .rating-label {
  font-size: 0.9rem;
  color: #555;
}

.chapter-star-rating {
  display: flex;
  gap: 0.25rem;
}

.chapter-star-rating .star-btn {
  font-size: 1.5rem;
}

/* === MODAL ACTION BUTTONS === */

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-primary {
  background: #16A085;
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #138D75;
}

.btn-primary:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Section feedback done state */
.section-feedback-done {
  color: #16A085;
  font-size: 0.9rem;
  font-weight: bold;
}

/* Rating comment in modal */
.rating-comment {
  margin-top: 0.75rem;
}

.rating-comment-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.rating-comment-input:focus {
  outline: none;
  border-color: #16A085;
}

/* Section comment form in modal */
.section-comment-form p {
  margin: 0 0 0.75rem 0;
  color: #555;
}

.section-comment-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.section-comment-input:focus {
  outline: none;
  border-color: #E67E22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

/* Admin login error */
.admin-login-error {
  color: #dc3545;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
  margin: 0.5rem 0;
}

/* Admin stats section */
.admin-stats h3,
.admin-feedback-list h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #2C3E50;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.feedback-section {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

/* === DARK MODE SUPPORT === */

@media (prefers-color-scheme: dark) {
  .iotclass-feedback-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: #333;
  }

  .feedback-container h4 {
    color: #e0e0e0;
  }

  .feedback-btn {
    background: #2a2a3e;
    border-color: #444;
    color: #e0e0e0;
  }

  .feedback-label {
    color: #aaa;
  }

  .feedback-comment-section textarea {
    background: #2a2a3e;
    border-color: #444;
    color: #e0e0e0;
  }

  .iotclass-progress-check {
    border-color: #444;
  }

  .progress-checkbox-label {
    background: #2a2a3e;
    border-color: #444;
    color: #aaa;
  }

  .progress-checkbox-label:hover {
    background: #3a3a4e;
    border-color: #555;
  }

  .stat-card {
    background: #2a2a3e;
  }

  .stat-number {
    color: #e0e0e0;
  }

  .feedback-item,
  .comment-item {
    background: #2a2a3e;
  }

  .feedback-chapter,
  .comment-chapter {
    color: #e0e0e0;
  }

  /* Section feedback dark mode */
  .trigger-icon {
    background: #2a2a3e;
    border-color: #444;
    color: #ccc;
  }

  .trigger-icon:hover {
    background: #3a3a4e;
    border-color: #555;
  }

  .trigger-icon.trigger-done {
    background: rgba(22, 160, 133, 0.2);
    border-color: #16A085;
    color: #16A085;
  }

  .section-feedback-popup {
    background: #2a2a3e;
    border-color: #444;
  }

  .popup-header {
    color: #aaa;
    border-color: #444;
  }

  .popup-btn:hover {
    background: #3a3a4e;
    border-color: #555;
  }

  .star-rating-popup {
    background: #2a2a3e;
    border-color: #444;
  }

  .star-rating-popup::before {
    background: #2a2a3e;
    border-color: #444;
  }

  .rating-row {
    border-color: #444;
  }

  .rating-label {
    color: #aaa;
  }

  .section-comment-modal {
    background: #2a2a3e;
  }

  .section-comment-modal h4 {
    color: #e0e0e0;
  }

  .section-comment-modal .section-name {
    color: #999;
    border-color: #444;
  }

  .section-comment-modal textarea {
    background: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
  }

  /* Chapter rating grid dark mode */
  .chapter-rating-grid {
    border-color: #444;
  }

  .chapter-rating-item .rating-label {
    color: #aaa;
  }

  /* Modal buttons dark mode */
  .section-comment-form p {
    color: #aaa;
  }

  .section-comment-input,
  .rating-comment-input {
    background: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
  }

  .section-feedback-done {
    color: #16A085;
  }

  .admin-stats h3,
  .admin-feedback-list h3 {
    color: #e0e0e0;
    border-color: #444;
  }

  .feedback-section {
    color: #777;
  }
}

/* === USER STATUS BAR === */

.iotclass-user-status {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-status-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-icon {
  font-size: 1rem;
}

.status-text {
  color: rgba(255,255,255,0.9);
}

.status-text strong {
  color: #16A085;
}

.user-id {
  font-family: monospace;
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.admin-badge .status-text {
  color: #f1c40f;
}

.admin-badge .status-text strong {
  color: #f1c40f;
}

.reader-badge .status-text {
  color: rgba(255,255,255,0.85);
}

.guest-badge .status-text {
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

.user-status-actions {
  display: flex;
  gap: 0.5rem;
}

.status-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.status-dashboard-btn {
  background: rgba(22, 160, 133, 0.3);
  border-color: #16A085;
}

.status-dashboard-btn:hover {
  background: rgba(22, 160, 133, 0.5);
}

.status-logout-btn {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.5);
}

.status-logout-btn:hover {
  background: rgba(231, 76, 60, 0.4);
  border-color: #e74c3c;
}

.status-login-btn {
  background: rgba(52, 152, 219, 0.2);
  border-color: rgba(52, 152, 219, 0.5);
}

.status-login-btn:hover {
  background: rgba(52, 152, 219, 0.4);
  border-color: #3498db;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .iotclass-user-status {
    padding: 0.4rem 0.75rem;
  }

  .user-status-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .status-text {
    font-size: 0.8rem;
  }

  .status-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .iotclass-user-status {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid #333;
  }
}

/* === ADMIN IMAGE VERSION MANAGEMENT === */

.admin-image-container {
  position: relative;
  display: inline-block;
}

.admin-image-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(44, 62, 80, 0.9);
  border: 2px solid #f1c40f;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  opacity: 0.6;
  z-index: 100;
}

.admin-image-container:hover .admin-image-indicator {
  opacity: 1;
}

.admin-image-indicator:hover {
  transform: scale(1.1);
  background: #2C3E50;
}

/* Image Version Panel */
.admin-image-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  min-width: 280px;
  max-width: 350px;
  z-index: 10001;
  overflow: hidden;
}

.image-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #2C3E50;
  color: white;
  font-weight: 500;
}

.image-panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.image-panel-body {
  padding: 1rem;
}

.current-image {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.image-path {
  font-size: 0.75rem;
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.version-list {
  max-height: 250px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.15s ease;
}

.version-item:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.version-item.selected {
  background: #e8f8f5;
  border-color: #16A085;
}

.version-preview {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}

.version-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.version-info {
  flex: 1;
  min-width: 0;
}

.version-name {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: #2C3E50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-type {
  display: block;
  font-size: 0.75rem;
  color: #888;
  text-transform: capitalize;
}

.version-actions {
  display: flex;
  gap: 0.25rem;
}

.version-select-btn,
.version-delete-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.version-select-btn:hover {
  background: #e8f8f5;
  border-color: #16A085;
  color: #16A085;
}

.version-delete-btn:hover {
  background: #fee;
  border-color: #e74c3c;
  color: #e74c3c;
}

.no-versions {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 1rem 0;
}

.add-version-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.add-version-btn {
  width: 100%;
  padding: 0.6rem;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 6px;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-version-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #333;
}

/* Add Version Modal Form */
.add-version-form .form-group {
  margin-bottom: 1rem;
}

.add-version-form label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.35rem;
}

.add-version-form input[type="text"],
.add-version-form select,
.add-version-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.add-version-form input:focus,
.add-version-form select:focus,
.add-version-form textarea:focus {
  outline: none;
  border-color: #16A085;
  box-shadow: 0 0 0 3px rgba(22,160,133,0.1);
}

/* === ADMIN SOURCE TAGGING === */

.admin-source-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  font-size: 0.85em;
  padding: 0.15rem 0.3rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  vertical-align: middle;
}

h2:hover .admin-source-indicator,
h3:hover .admin-source-indicator,
h4:hover .admin-source-indicator,
h5:hover .admin-source-indicator,
.admin-source-indicator:hover {
  opacity: 1;
}

.admin-source-indicator:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* Source Tag Panel */
.admin-source-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  min-width: 260px;
  max-width: 320px;
  z-index: 10001;
  overflow: hidden;
}

.source-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #34495E;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
}

.source-panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.source-panel-body {
  padding: 0.75rem;
}

.source-list {
  max-height: 200px;
  overflow-y: auto;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  transition: all 0.15s ease;
}

.source-item:hover {
  background: #f8f9fa;
}

.source-item.tagged {
  background: #e8f8f5;
  border-color: #16A085;
}

.source-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.source-name {
  flex: 1;
  font-size: 0.9rem;
  color: #333;
}

.source-toggle-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-item.tagged .source-toggle-btn {
  background: #16A085;
  border-color: #16A085;
  color: white;
}

.source-toggle-btn:hover {
  background: #e9ecef;
}

.source-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.manage-sources-btn {
  width: 100%;
  padding: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #555;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.manage-sources-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.no-sources {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.75rem 0;
}

/* Source Tag Bar (displayed on sections) */
.source-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.source-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: white;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Quick Source Menu (right-click context menu) */
.quick-source-menu {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  min-width: 180px;
  z-index: 10002;
  overflow: hidden;
}

.source-menu-header {
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  font-size: 0.75rem;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #eee;
}

.source-menu-item {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

.source-menu-item:hover {
  background: #f0f0f0;
}

.source-menu-cancel {
  color: #888;
  border-top: 1px solid #eee;
  text-align: center;
}

/* Source Management Modal */
.source-management {
  max-height: 60vh;
  overflow-y: auto;
}

.source-list-manage {
  margin-bottom: 1.5rem;
}

.source-manage-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.source-color-block {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

.source-manage-item .source-name {
  flex: 1;
  font-weight: 500;
}

.source-type {
  font-size: 0.8rem;
  color: #888;
  text-transform: capitalize;
}

.source-edit-btn,
.source-delete-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-edit-btn:hover {
  background: #e8f8f5;
  border-color: #16A085;
}

.source-delete-btn:hover {
  background: #fee;
  border-color: #e74c3c;
  color: #e74c3c;
}

.add-source-section {
  padding-top: 1rem;
  border-top: 2px solid #eee;
}

.add-source-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #333;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-row input,
.form-row select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #16A085;
}

.source-color-input {
  width: 50px !important;
  flex: 0 0 50px !important;
  padding: 0.25rem !important;
  cursor: pointer;
}

.source-desc-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.add-source-btn {
  width: 100%;
  padding: 0.6rem;
  background: #16A085;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.add-source-btn:hover {
  background: #138D75;
}

/* Dark mode for admin features */
@media (prefers-color-scheme: dark) {
  .admin-image-panel,
  .admin-source-panel,
  .quick-source-menu {
    background: #2a2a3e;
    color: #e0e0e0;
  }

  .image-panel-body,
  .source-panel-body {
    background: #2a2a3e;
  }

  .current-image {
    color: #aaa;
    border-color: #444;
  }

  .image-path {
    background: #1a1a2e;
    color: #ddd;
  }

  .version-item,
  .source-item {
    border-color: #444;
  }

  .version-item:hover,
  .source-item:hover {
    background: #3a3a4e;
  }

  .version-item.selected,
  .source-item.tagged {
    background: rgba(22,160,133,0.2);
    border-color: #16A085;
  }

  .version-name {
    color: #e0e0e0;
  }

  .add-version-btn,
  .manage-sources-btn {
    background: #3a3a4e;
    border-color: #555;
    color: #ccc;
  }

  .add-version-btn:hover,
  .manage-sources-btn:hover {
    background: #4a4a5e;
    border-color: #666;
  }

  .add-version-form input,
  .add-version-form select,
  .add-version-form textarea,
  .form-row input,
  .form-row select,
  .source-desc-input {
    background: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
  }

  .source-menu-header {
    background: #3a3a4e;
    border-color: #444;
    color: #aaa;
  }

  .source-menu-item:hover {
    background: #3a3a4e;
  }

  .source-menu-cancel {
    border-color: #444;
    color: #888;
  }

  .source-manage-item {
    background: #3a3a4e;
  }

  .source-tag-bar {
    border-color: #444;
  }

  .admin-source-indicator {
    background: #2a2a3e;
    border-color: #444;
    color: #ccc;
  }

  .admin-source-indicator:hover {
    background: #3a3a4e;
    border-color: #555;
  }
}

/* === TRANSFER LOG DASHBOARD === */

.transfer-log-container {
  max-height: 60vh;
  overflow-y: auto;
}

.transfer-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #eee;
}

.transfer-log-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #2C3E50;
}

.transfer-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.transfer-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  min-width: 80px;
}

.transfer-stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2C3E50;
}

.transfer-stat-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
}

.transfer-stat.stat-matched {
  background: #e8f8f5;
  border-left: 3px solid #16A085;
}

.transfer-stat.stat-inserted {
  background: #e3f2fd;
  border-left: 3px solid #2196f3;
}

.transfer-stat.stat-merged {
  background: #fff8e1;
  border-left: 3px solid #f9a825;
}

.transfer-stat.stat-skipped {
  background: #fce4ec;
  border-left: 3px solid #e91e63;
}

/* Transfer Filters */
.transfer-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.transfer-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transfer-filter label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

.transfer-filter select,
.transfer-filter input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 120px;
}

.transfer-filter select:focus,
.transfer-filter input:focus {
  outline: none;
  border-color: #16A085;
}

/* Transfer List */
.transfer-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transfer-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
}

.transfer-item.action-matched {
  border-left-color: #16A085;
}

.transfer-item.action-inserted {
  border-left-color: #2196f3;
}

.transfer-item.action-merged {
  border-left-color: #f9a825;
}

.transfer-item.action-skipped {
  border-left-color: #e91e63;
}

.transfer-source-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.transfer-source-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.transfer-source-name {
  font-weight: 500;
  color: #333;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.transfer-path {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
}

.transfer-path-source {
  color: #666;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-path-arrow {
  color: #16A085;
  font-weight: bold;
}

.transfer-path-target {
  color: #2C3E50;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-preview {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-action {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.transfer-action.action-matched {
  background: #e8f8f5;
  color: #16A085;
}

.transfer-action.action-inserted {
  background: #e3f2fd;
  color: #1976d2;
}

.transfer-action.action-merged {
  background: #fff8e1;
  color: #f57c00;
}

.transfer-action.action-skipped {
  background: #fce4ec;
  color: #c2185b;
}

.transfer-time {
  font-size: 0.75rem;
  color: #999;
  white-space: nowrap;
}

/* Empty state */
.transfer-empty {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-style: italic;
}

/* Transfer log actions */
.transfer-log-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.transfer-action-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #f8f9fa;
  color: #555;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.transfer-action-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.transfer-action-btn.btn-danger {
  color: #dc3545;
}

.transfer-action-btn.btn-danger:hover {
  background: #fee;
  border-color: #dc3545;
}

/* Admin Modal Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.admin-tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: #666;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-tab:hover {
  color: #333;
  background: #f8f9fa;
}

.admin-tab.active {
  color: #16A085;
  border-bottom-color: #16A085;
  font-weight: 500;
}

.admin-tab-content {
  display: none;
}

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

/* Dark mode for transfer log */
@media (prefers-color-scheme: dark) {
  .transfer-log-header h3 {
    color: #e0e0e0;
  }

  .transfer-log-header {
    border-color: #444;
  }

  .transfer-stat {
    background: #3a3a4e;
  }

  .transfer-stat-value {
    color: #e0e0e0;
  }

  .transfer-filters {
    background: #3a3a4e;
  }

  .transfer-filter select,
  .transfer-filter input {
    background: #2a2a3e;
    border-color: #555;
    color: #e0e0e0;
  }

  .transfer-item {
    background: #3a3a4e;
  }

  .transfer-source-name {
    color: #e0e0e0;
  }

  .transfer-path-target {
    color: #e0e0e0;
  }

  .admin-tabs {
    border-color: #444;
  }

  .admin-tab {
    color: #aaa;
  }

  .admin-tab:hover {
    color: #e0e0e0;
    background: #3a3a4e;
  }

  .admin-tab.active {
    color: #16A085;
  }

  .transfer-log-actions {
    border-color: #444;
  }

  .transfer-action-btn {
    background: #3a3a4e;
    border-color: #555;
    color: #ccc;
  }

  .transfer-action-btn:hover {
    background: #4a4a5e;
    border-color: #666;
  }
}
