/* Google Classroom–inspired UI for Aegis Learn */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap');

:root {
  --gc-bg: #f8f9fa;
  --gc-surface: #ffffff;
  --gc-border: #e0e0e0;
  --gc-text: #3c4043;
  --gc-muted: #5f6368;
  --gc-link: #1a73e8;
  --gc-header: #ffffff;
  --gc-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --gc-shadow-hover: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --gc-radius: 8px;
  --gc-font: 'Roboto', 'Google Sans', system-ui, sans-serif;
  --gc-topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--gc-font);
  background: var(--gc-bg);
  color: var(--gc-text);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gc-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top app bar ── */
.gc-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--gc-topbar-h);
  background: var(--gc-header);
  border-bottom: 1px solid var(--gc-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.gc-menu-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gc-muted);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gc-menu-btn:hover { background: rgba(60,64,67,.08); }

.gc-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gc-text) !important;
  text-decoration: none !important;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
}
.gc-logo img, .gc-logo-icon {
  width: 30px;
  height: 24px;
  object-fit: contain;
}
.gc-logo-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 24px;
  height: 24px;
}
.gc-logo-icon span {
  border-radius: 2px;
  background: #1a73e8;
}
.gc-logo-icon span:nth-child(2) { background: #ea4335; }
.gc-logo-icon span:nth-child(3) { background: #fbbc04; }
.gc-logo-icon span:nth-child(4) { background: #34a853; }

.gc-topbar-spacer { flex: 1; }

.gc-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
}

/* ── Class home (card grid) ── */
.gc-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.gc-page-title {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 20px;
  color: var(--gc-text);
}

.gc-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gc-class-card {
  background: var(--gc-surface);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: box-shadow .15s ease;
  text-decoration: none !important;
  color: inherit !important;
  position: relative;
}
.gc-class-card:hover { box-shadow: var(--gc-shadow-hover); }

.gc-class-banner {
  height: 100px;
  padding: 16px;
  color: #fff;
  position: relative;
  background: linear-gradient(135deg, #1967d2, #174ea6);
}
.gc-class-banner.theme-1 { background: linear-gradient(135deg, #1967d2, #174ea6); }
.gc-class-banner.theme-2 { background: linear-gradient(135deg, #137333, #0d652d); }
.gc-class-banner.theme-3 { background: linear-gradient(135deg, #c5221f, #a50e0e); }
.gc-class-banner.theme-4 { background: linear-gradient(135deg, #e37400, #b06000); }
.gc-class-banner.theme-5 { background: linear-gradient(135deg, #9334e6, #7627bb); }

.gc-class-banner h2 {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gc-class-banner .section {
  font-size: 0.875rem;
  opacity: 0.95;
  margin-top: 4px;
}

.gc-class-body {
  flex: 1;
  padding: 12px 16px 16px;
  font-size: 0.875rem;
  color: var(--gc-muted);
}
.gc-class-footer {
  border-top: 1px solid var(--gc-border);
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

/* ── Inside a class ── */
.gc-class-header {
  background: var(--gc-surface);
  border-bottom: 1px solid var(--gc-border);
}
.gc-class-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}
.gc-class-tabs {
  display: flex;
  gap: 0;
  margin-top: 0;
}
.gc-class-tabs a {
  padding: 14px 20px;
  color: var(--gc-muted);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none !important;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.gc-class-tabs a:hover { background: rgba(26,115,232,.04); color: var(--gc-text); }
.gc-class-tabs a.active {
  color: #1967d2;
  border-bottom-color: #1967d2;
}

.gc-banner-wide {
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 0 24px;
}
.gc-banner-wide .banner {
  border-radius: var(--gc-radius);
  min-height: 200px;
  padding: 24px 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--gc-shadow);
}
.gc-banner-wide h1 {
  font-size: 2rem;
  font-weight: 500;
}
.gc-banner-wide p { opacity: 0.95; margin-top: 4px; }

.gc-stream, .gc-classwork {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .gc-stream {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

.gc-upcoming {
  background: var(--gc-surface);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: 16px;
  font-size: 0.875rem;
}
.gc-upcoming h3 {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--gc-text);
}
.gc-upcoming .empty { color: var(--gc-muted); }

.gc-announce, .gc-post, .gc-work-item {
  background: var(--gc-surface);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: 16px 20px;
}

.gc-announce {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gc-muted);
  cursor: default;
}
.gc-announce .gc-avatar { flex-shrink: 0; }

.gc-post-head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.gc-post-meta .name { font-weight: 500; font-size: 0.9rem; }
.gc-post-meta .when { font-size: 0.75rem; color: var(--gc-muted); }

.gc-work-group { margin-bottom: 28px; }
.gc-work-group h2 {
  font-size: 1.375rem;
  font-weight: 400;
  padding-bottom: 8px;
  border-bottom: 1px solid #1967d2;
  color: #1967d2;
  margin-bottom: 8px;
}

.gc-work-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  margin-top: 4px;
  transition: background .1s;
}
.gc-work-item:hover { background: #f1f3f4; }
.gc-work-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1967d2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.gc-work-icon.material { background: #1967d2; }
.gc-work-icon.quiz { background: #137333; }
.gc-work-text { flex: 1; min-width: 0; }
.gc-work-text a {
  color: var(--gc-text) !important;
  font-weight: 500;
  text-decoration: none !important;
}
.gc-work-text a:hover { color: var(--gc-link) !important; text-decoration: underline !important; }
.gc-work-text .sub { font-size: 0.8rem; color: var(--gc-muted); margin-top: 2px; }

/* ── Material / assignment detail ── */
.gc-detail {
  max-width: 720px;
  margin: 24px auto 48px;
  padding: 0 24px;
}
.gc-detail-card {
  background: var(--gc-surface);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: 24px;
}
.gc-detail-card h1 {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 8px;
}
.gc-detail-meta {
  font-size: 0.8rem;
  color: var(--gc-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gc-border);
}
.gc-detail-body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.6;
}
.gc-quiz-q {
  margin: 20px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gc-border);
}
.gc-quiz-q legend {
  font-weight: 500;
  margin-bottom: 10px;
}
.gc-quiz-q label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin: 4px 0;
}
.gc-quiz-q label:hover { background: #f1f3f4; }

.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 4px;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: #1a73e8;
  color: #fff !important;
  text-decoration: none !important;
}
.gc-btn:hover { background: #1765cc; text-decoration: none !important; }
.gc-btn-text {
  background: transparent;
  color: #1a73e8 !important;
  border: none;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: inherit;
}
.gc-btn-text:hover { background: rgba(26,115,232,.08); }

.gc-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gc-muted);
}

@media (max-width: 600px) {
  .gc-main { padding: 16px; }
  .gc-banner-wide .banner { min-height: 140px; }
  .gc-banner-wide h1 { font-size: 1.5rem; }
}

/* Assignment detail (Classroom “Your work”) */
.gc-work-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 900px) {
  .gc-work-page {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}
.gc-work-main { background: #fff; }
.gc-work-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}
.gc-work-title {
  font-size: 2rem;
  font-weight: 400;
  color: #1967d2;
  margin-bottom: 8px;
}
.gc-work-meta {
  font-size: 0.875rem;
  color: var(--gc-muted);
}
.gc-work-points { margin-top: 4px; }
.gc-work-rule {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 16px 0;
}
.gc-work-instructions {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 32px;
}
.gc-work-comments-block { margin-top: 8px; }
.gc-work-comments-head {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gc-link-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-weight: 500;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px 0;
}
.gc-link-btn:hover { text-decoration: underline; }
.gc-comment-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 0;
  font: inherit;
  margin-bottom: 4px;
  background: transparent;
}
.gc-comment-input:focus { outline: none; border-bottom-color: #1a73e8; }
.gc-comment { margin: 12px 0; font-size: 0.9rem; }
.gc-comment-meta { font-size: 0.75rem; color: var(--gc-muted); margin-top: 4px; }

.gc-your-work, .gc-private-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.gc-your-work-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  margin-bottom: 16px;
}
.gc-status { font-size: 0.8rem; color: var(--gc-muted); font-weight: 400; }
.gc-btn-outline {
  width: 100%;
  padding: 10px;
  border-radius: 24px;
  border: 1px solid #dadce0;
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a73e8;
  cursor: pointer;
  margin-bottom: 10px;
}
.gc-btn-outline:hover { background: #f1f3f4; }
.gc-btn-handin {
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  border: none;
  background: #1a73e8;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.gc-btn-handin:hover { background: #1765cc; }
.gc-attachment {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  font-size: 0.85rem;
}
.gc-attachment-title { font-weight: 500; }
.gc-attachment-sub { color: var(--gc-muted); font-size: 0.8rem; }


.gc-embed-wrap {
  margin: 16px 0 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  background: #f1f3f4;
}
.gc-embed {
  width: 100%;
  min-height: 480px;
  border: 0;
  display: block;
  background: #fff;
}
.gc-embed-note {
  font-size: 0.8rem;
  color: var(--gc-muted);
  padding: 8px 12px;
  margin: 0;
}
.gc-file-chip {
  display: inline-block;
  padding: 8px 12px;
  margin: 4px 8px 4px 0;
  background: #e8f0fe;
  color: #1967d2 !important;
  border-radius: 8px;
  font-size: 0.875rem;
  text-decoration: none !important;
}
.gc-file-chip:hover { background: #d2e3fc; }
.gc-protected .gc-work-instructions,
.gc-protected .gc-embed-wrap {
  -webkit-user-select: none;
  user-select: none;
}


.gc-progress { margin-top: 12px; }
.gc-progress-bar {
  height: 8px;
  background: #e8eaed;
  border-radius: 4px;
  overflow: hidden;
}
.gc-progress-bar span {
  display: block;
  height: 100%;
  background: #1a73e8;
  border-radius: 4px;
  min-width: 0;
  transition: width .2s ease;
}
.gc-progress-label {
  font-size: 0.75rem;
  color: var(--gc-muted);
  margin-top: 6px;
}
.gc-todo-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--gc-shadow);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.gc-todo-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.gc-todo-list { list-style: none; padding: 0; margin: 0; }
.gc-todo-list li { border-top: 1px solid #e8eaed; }
.gc-todo-list a {
  display: block;
  padding: 12px 0;
  text-decoration: none !important;
  color: inherit !important;
}
.gc-todo-list a:hover .gc-todo-work { color: #1a73e8; }
.gc-todo-work { font-weight: 500; display: block; }
.gc-todo-class { font-size: 0.8rem; color: var(--gc-muted); }
.gc-todo-empty p { color: var(--gc-muted); font-size: 0.9rem; margin: 0; }


.gc-grades-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--gc-shadow);
  padding: 16px 20px 8px;
  margin-bottom: 20px;
}
.gc-grades-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.gc-grades-person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gc-grades-name { font-weight: 500; }
.gc-grades-sub { font-size: 0.8rem; color: var(--gc-muted); }
.gc-grades-prog { text-align: right; }
.gc-grades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 8px;
}
.gc-grades-table th {
  text-align: left;
  font-weight: 500;
  color: var(--gc-muted);
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid #e8eaed;
}
.gc-grades-table td {
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: top;
}
.gc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}
.gc-badge-done { background: #e6f4ea; color: #137333; }
.gc-badge-todo { background: #fef7e0; color: #b06000; }

.gc-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.gc-add-create-wrap { position: relative; margin-bottom: 10px; }
.gc-add-menu {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(60,64,67,.3);
  z-index: 20;
  padding: 8px 0;
  border: 1px solid #e0e0e0;
}
.gc-add-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  color: var(--gc-text);
}
.gc-add-menu-item:hover { background: #f1f3f4; }
.gc-add-icon { width: 1.25rem; text-align: center; }
.gc-link-prompt {
  margin: 8px 0 12px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.gc-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gc-viewer-page {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: #202124;
  color: #e8eaed;
}
.gc-viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #292a2d;
  border-bottom: 1px solid #3c4043;
}
.gc-viewer-back { color: #8ab4f8 !important; text-decoration: none !important; font-size: 0.9rem; }
.gc-viewer-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-viewer-actions { display: flex; align-items: center; gap: 8px; }
.gc-viewer-stage {
  flex: 1;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  background: #000;
}
.gc-viewer-frame {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 70vh;
  background: #525659;
}
.gc-viewer-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}
.gc-viewer-image {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.gc-viewer-fallback {
  margin: auto;
  text-align: center;
  padding: 32px 16px;
  color: #e8eaed;
}
.gc-viewer-hint {
  font-size: 0.8rem;
  color: #9aa0a6;
  padding: 8px 16px;
  margin: 0;
  background: #292a2d;
}
@media (max-width: 720px) {
  .gc-viewer-title { font-size: 0.85rem; }
  .gc-viewer-frame { min-height: 55vh; }
}
