@import url("https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&display=swap");

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --blue: #2563eb;
  --blue-light: #60a5fa;
  --orange: #ea580c;
  --orange-light: #fb923c;
  --cyan: #0891b2;
  --pink: #db2777;
  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
  --gradient-subtle: linear-gradient(180deg, rgba(124, 58, 237, 0.12) 0%, transparent 60%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.15);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Heebo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(124, 58, 237, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(219, 39, 119, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-area img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text span:first-child {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.logo-text span:last-child {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-ghost {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Hero */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--purple-light);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* Course Grid */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.course-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.course-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--course-color, var(--purple));
  opacity: 0.8;
}

.course-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.course-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.course-card:hover::after {
  opacity: 1;
}

.course-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--course-color, var(--purple-light));
  margin-bottom: 1rem;
}

.course-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.course-subtitle {
  font-size: 0.85rem;
  color: var(--course-color, var(--purple-light));
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.course-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.course-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.course-arrow {
  position: absolute;
  bottom: 1.75rem;
  left: 1.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.course-card:hover .course-arrow {
  background: var(--course-color, var(--purple));
  color: white;
  transform: translateX(-4px);
}

/* Outcomes Section */
.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.outcome-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.outcome-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Syllabus View */
.syllabus-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.syllabus-header {
  margin-bottom: 2.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--text);
}

.syllabus-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--course-color, var(--purple-light));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.syllabus-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.syllabus-header .subtitle {
  font-size: 1rem;
  color: var(--course-color, var(--purple-light));
  font-weight: 500;
  margin-bottom: 1rem;
}

.syllabus-header .description {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  line-height: 1.65;
}

.syllabus-stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.syllabus-stat {
  display: flex;
  flex-direction: column;
}

.syllabus-stat .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--course-color, var(--purple-light));
}

.syllabus-stat .label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Module Accordion */
.modules-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.module-card.open {
  border-color: var(--border-strong);
}

.module-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  text-align: right;
  color: var(--text);
  transition: var(--transition);
}

.module-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.module-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.module-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.module-card.open .module-toggle {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.1);
}

.module-body {
  display: none;
  padding: 0 1.5rem 1.5rem;
}

.module-card.open .module-body {
  display: block;
}

.section-block {
  margin-bottom: 1.25rem;
}

.section-block:last-child {
  margin-bottom: 0;
}

.section-block h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--course-color, var(--purple-light));
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.topic-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.topic-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
}

.topic-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--course-color, var(--purple));
  flex-shrink: 0;
  opacity: 0.7;
}

/* Outcomes in syllabus */
.syllabus-section {
  margin-top: 2.5rem;
}

.syllabus-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.outcomes-list {
  display: grid;
  gap: 0.6rem;
}

.outcome-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.outcome-row .icon {
  color: var(--course-color, var(--purple-light));
  font-weight: 700;
}

/* Graduation projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.project-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer img {
  height: 40px;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

/* Print */
@media print {
  body::before,
  .header,
  .back-btn,
  .course-arrow,
  .nav-actions {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .course-card,
  .module-card,
  .syllabus-stats-bar {
    break-inside: avoid;
    border: 1px solid #ddd;
  }

  .module-body {
    display: block !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.875rem 1rem;
  }

  .logo-area img {
    height: 40px;
  }

  .hero {
    padding: 2.5rem 1rem 2rem;
  }

  .section,
  .syllabus-view {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 1.25rem;
  }
}

/* View transitions */
.view-enter {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* Notes panel */
.notes-panel {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 3px solid var(--course-color, var(--purple));
}

.notes-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.notes-panel-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  max-width: 640px;
}

.notes-draft-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-light);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.notes-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.notes-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-input,
.field-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--course-color, var(--purple));
  background: rgba(255, 255, 255, 0.06);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
}

.notes-subsection {
  padding-top: 0.5rem;
}

.notes-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.notes-subsection h3 {
  font-size: 1rem;
  font-weight: 700;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.suggested-modules-list,
.module-notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.suggested-module-card {
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.suggested-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.suggested-module-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--course-color, var(--purple-light));
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.module-note-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notes-empty {
  color: var(--text-dim);
  font-size: 0.875rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.notes-status {
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.notes-status--success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.notes-status--error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Admin */
.admin-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-login {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-login h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.admin-login p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.submission-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.submission-header h3 {
  font-size: 1.1rem;
}

.submission-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.submission-date {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.submission-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.submission-block h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--purple-light);
}

.submission-module {
  padding: 0.75rem 0;
}

.submission-module + .submission-module {
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .notes-fields-row {
    grid-template-columns: 1fr;
  }

  .notes-panel-header {
    flex-direction: column;
  }

  .notes-actions {
    flex-direction: column;
  }

  .notes-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .notes-panel,
  .admin-view {
    display: none !important;
  }
}
