/* WorksBox Extension - Production Grade Professional Stylesheet */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 380px;
  height: 540px;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #090d16;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  padding: 12px 16px;
  background-color: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background-color: #1e293b;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: #334155;
  color: #f8fafc;
}

/* User Profile Banner */
.user-account-banner {
  padding: 10px 16px;
  background-color: #0c1322;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.user-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  border: 1.5px solid rgba(147, 197, 253, 0.3);
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-text-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.user-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-indicator {
  font-size: 8px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-email {
  font-size: 9px;
  color: #60a5fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta {
  font-size: 9px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Account Settings Drawer */
.account-config-panel {
  padding: 12px 16px;
  background-color: #0f172a;
  border-bottom: 1px solid rgba(37, 99, 235, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.account-config-panel.hidden {
  display: none !important;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
}

.close-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.field-group label {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
}

.field-group input, .field-group select {
  background-color: #090d16;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  color: #f1f5f9;
  outline: none;
}

.field-group input:focus, .field-group select:focus {
  border-color: #2563eb;
}

.field-grid {
  display: flex;
  gap: 8px;
}

.primary-btn {
  padding: 6px 12px;
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin-top: 2px;
}

.primary-btn:hover {
  background-color: #1d4ed8;
}

/* Controls Section (Search & Segmented Filter) */
.controls-section {
  padding: 10px 16px;
  background-color: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 11px;
  color: #f8fafc;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: #2563eb;
}

.search-box input::placeholder {
  color: #475569;
}

/* Segmented Control Bar */
.segmented-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background-color: #0f172a;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.seg-btn {
  flex: 1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.seg-btn:hover {
  color: #f8fafc;
}

.seg-btn.active {
  background-color: #1e293b;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Course Cards Area */
.course-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-card {
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.course-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background-color: #111c35;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
}

/* Unboxed Clean Metadata Line (Zero-Pill Discipline) */
.card-unboxed-meta {
  font-size: 9.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-subject {
  color: #60a5fa;
  font-weight: 600;
}

.meta-dot {
  color: #475569;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.meta-school {
  font-size: 9px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.open-btn {
  font-size: 9.5px;
  font-weight: 700;
  color: #3b82f6;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.open-btn:hover {
  color: #60a5fa;
}

/* Loading & Empty State */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 180px;
  gap: 8px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
footer {
  padding: 10px 16px;
  background-color: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #64748b;
  flex-shrink: 0;
}

.footer-note {
  font-size: 9px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-btn {
  font-size: 10px;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.footer-btn:hover {
  color: #93c5fd;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
