/* ===============================
   UI-003: Theme & Styling System - General Cards
================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.6);
}
.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--accent);
}

/* ===============================
   UI-003: Theme & Styling System - Class Cards
================================ */
.class-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.class-header h3 {
  margin: 0;
  color: var(--text-light);
  line-height: 1.3;
  flex: 1;
  padding-top: 0.25rem;
}

.class-header .status-toggle {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* ===============================
   UI-003: Theme & Styling System - School Year Cards
================================ */
#schoolYearsList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.school-year-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.school-year-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border-color: var(--accent);
}

.school-year-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.school-year-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.3;
  flex: 1;
}

/* ===============================
   UI-003: Theme & Styling System - Status Toggle Switch
================================ */
.status-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: fit-content;
}

.status-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-slider {
  position: relative;
  width: 40px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-toggle.active .toggle-slider {
  background: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.status-toggle.completed .toggle-slider {
  background: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.status-toggle.inactive .toggle-slider {
  background: var(--border);
  border-color: rgba(148, 163, 184, 0.3);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-toggle.active .toggle-knob {
  transform: translateX(20px);
}

.status-toggle.completed .toggle-knob {
  transform: translateX(20px);
  background: #e0f2fe;
}

.toggle-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
  min-width: 45px;
  text-align: left;
  white-space: nowrap;
}

.status-toggle.active .toggle-label {
  color: var(--success);
}

/* Table view toggle adjustments */
.modern-table .status-toggle {
  margin: 0;
  padding: 0.125rem;
}

.modern-table .toggle-slider {
  width: 32px;
  height: 16px;
}

.modern-table .toggle-knob {
  width: 12px;
  height: 12px;
  top: 1px;
  left: 1px;
}

.modern-table .status-toggle.active .toggle-knob {
  transform: translateX(16px);
}

.modern-table .toggle-label {
  font-size: 0.7rem;
  min-width: 40px;
}

/* ===============================
   UI-003: Theme & Styling System - My Classes Status Display
================================ */
.class-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.class-card-header h3 {
  margin: 0;
  color: var(--text-light);
  line-height: 1.3;
  flex: 1;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
  flex-grow: 0;
}

.status-indicator:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.status-indicator.active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 2px solid rgba(34, 197, 94, 0.4);
}

.status-indicator.inactive {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 2px solid rgba(148, 163, 184, 0.4);
}

.status-indicator.completed {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 2px solid rgba(59, 130, 246, 0.4);
}

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

.status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75px;
  display: inline-block;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

.status-indicator.inactive .status-dot {
  animation: none;
}

.status-indicator.completed .status-dot {
  animation: none;
}

/* Inline Status Dot (for class names) */
.inline-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-status-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.inline-status-dot.completed {
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.inline-status-dot.inactive {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.inline-status-dot:hover {
  transform: scale(1.2);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.inactive-class {
  opacity: 0.6;
  background: rgba(148, 163, 184, 0.05);
  border-color: rgba(148, 163, 184, 0.2);
}

.inactive-class h3 {
  color: var(--text-muted);
}

.inactive-class button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border);
  color: var(--text-muted);
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.inactive {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.school-year-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  justify-content: center;
}

.btn-sm svg {
  flex-shrink: 0;
}

/* Responsive adjustments for school year cards */
@media (max-width: 768px) {
  #schoolYearsList {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  #schoolYearsList {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ===============================
   UI-003: Theme & Styling System - User Cards
================================ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}

.user-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
}
.user-card p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.user-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ===============================
   UI-003: Theme & Styling System - Table View for Users
================================ */
.users-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.users-table th, .users-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.users-table th {
  background: var(--bg-panel);
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
}
.users-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}
.users-table td {
  white-space: nowrap;
}
.users-table td .btn-icon {
  display: inline-flex;
  margin-right: 0.25rem;
}

/* ===============================
   Buttons
================================ */
.btn-secondary {
  background: var(--bg-panel);
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover {
  background: #1e293b;
}

.btn-danger {
  background: var(--danger);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover {
  background: #dc2626;
}
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.modern-table th,
.modern-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.modern-table td {
  white-space: nowrap;
}

.modern-table td .btn-icon {
  display: inline-flex;
  margin-right: 0.25rem;
}

.modern-table th {
  background: var(--bg-panel);
  color: var(--text-light);
  font-weight: bold;
}

.modern-table tr:hover {
  background: rgba(255,255,255,0.05);
}

/* ===============================
   UI-003: Student Assignment Cards - Organized Layout
================================ */

/* Assignment meta organization */
.assignment-meta {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.due-date-info,
.assignment-type,
.points-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.due-date-info svg,
.assignment-type svg,
.points-info svg {
  color: var(--accent);
}

.assignment-description {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-panel);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.assignment-description h6 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.assignment-description p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.875rem;
}

/* Compact button styles */
.btn-outline.compact,
.btn-primary.compact {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 0.3rem;
}

.upload-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

/* ===============================
   UI-003: Original Student Assignment Cards
================================ */

/* Student submission area styles */
.student-submission-area {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.submission-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.submission-header h5 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.submission-header svg {
  color: var(--accent);
}

.student-submission-card {
  background: var(--background-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.student-submission-card.pending {
  border-color: var(--warning, #f59e0b);
}

.submission-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.submission-status.submitted {
  background: var(--success-bg, rgba(34, 197, 94, 0.1));
  color: var(--success, #22c55e);
  border-bottom: 1px solid var(--border-color);
}

.submission-status.pending {
  background: var(--warning-bg, rgba(245, 158, 11, 0.1));
  color: var(--warning, #f59e0b);
  border-bottom: 1px solid var(--border-color);
}

.submission-file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-dark);
  border-radius: 8px;
  color: var(--accent);
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.file-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.submission-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}

.upload-section {
  padding: 1rem;
  text-align: center;
}

.upload-instructions {
  margin-bottom: 1rem;
}

.upload-instructions svg {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.upload-instructions p {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-weight: 500;
}

.upload-instructions small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.upload-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg, rgba(99, 102, 241, 0.1));
}

/* Enhanced button styles for student cards */
.submission-actions .btn-secondary,
.submission-actions .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.upload-controls .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Modern icon-only button styles for student submission actions */
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0;
}

.btn-icon-only:hover {
  background: var(--bg-dark);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-icon-only.preview-btn:hover {
  background: var(--info-bg, rgba(14, 165, 233, 0.1));
  border-color: var(--info, #0ea5e9);
  color: var(--info, #0ea5e9);
}

.btn-icon-only.delete-btn:hover {
  background: var(--danger-bg, rgba(239, 68, 68, 0.1));
  border-color: var(--danger, #ef4444);
  color: var(--danger, #ef4444);
}

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

/* ===============================
   UI-003: Enhanced Dashboard Assignment Cards
================================ */

.assignment-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assignment-item:hover {
  background: var(--bg-panel);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.assignment-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-bg, rgba(99, 102, 241, 0.1));
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

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

.assignment-info h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.assignment-class {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.assignment-class svg {
  color: var(--accent);
}

.assignment-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge.active {
  background: var(--info-bg, rgba(14, 165, 233, 0.1));
  color: var(--info, #0ea5e9);
}

.status-badge.due-soon {
  background: var(--warning-bg, rgba(245, 158, 11, 0.1));
  color: var(--warning, #f59e0b);
}

.status-badge.no-due-date {
  background: var(--muted-bg, rgba(148, 163, 184, 0.1));
  color: var(--text-muted);
}

.status-badge.overdue {
  background: var(--danger-bg, rgba(239, 68, 68, 0.1));
  color: var(--danger, #ef4444);
}

.due-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.due-date svg {
  color: var(--accent);
}

.no-assignments {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Dashboard widget specific styles */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.widget-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.assignments-list {
  max-height: 400px;
  overflow-y: auto;
}

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .assignment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
      }
      
      .assignment-status {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
      }
      
      .assignment-desc {
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box;
      }
      
      /* Student assignment cards responsive */
      .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }
      
      .upload-controls {
        flex-direction: column;
        width: 100%;
      }
      
      .btn-outline.compact,
      .btn-primary.compact {
        width: 100%;
        justify-content: center;
      }
    }
