/* ==========================================================================
   Astra Study - Academic Flight Path / خطة دراسة الطب (256 Credit Hours)
   Cosmic Dark Theme Stylesheet
   ========================================================================== */

#study-plan-view {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: radial-gradient(ellipse at 50% -10%, #111736 0%, #060814 65%, #020308 100%);
  overflow-y: auto;
  overflow-x: hidden;
  color: #f8fafc;
  font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, sans-serif;
  direction: rtl;
}

#study-plan-view.hidden {
  display: none !important;
}

/* Custom Scrollbar for Flight Path */
#study-plan-view::-webkit-scrollbar {
  width: 8px;
}
#study-plan-view::-webkit-scrollbar-track {
  background: rgba(6, 8, 20, 0.8);
}
#study-plan-view::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
#study-plan-view::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

/* Header Bar */
.flight-path-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.flight-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.flight-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  direction: ltr;
}

.flight-back-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: translateX(3px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.flight-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flight-main-title {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #ffffff 30%, #7dd3fc 70%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.flight-sub-title {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.flight-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flight-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.flight-action-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

/* Main Flight Path Container */
.flight-path-body {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==========================================================================
   Top Cosmic Counter HUD
   ========================================================================== */

.flight-hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.hud-card {
  background: rgba(15, 21, 44, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hud-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.hud-card-accent-glow {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.4;
}

.glow-cyan {
  background: #06b6d4;
}

.glow-purple {
  background: #a855f7;
}

.glow-emerald {
  background: #10b981;
}

.hud-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.hud-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.hud-pill-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  direction: ltr;
}

/* Card 1: Total Degree Hours */
.hud-total-number-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.hud-huge-number {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
}

.hud-unit-text {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
}

.hud-desc-note {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Card 2: Orbit Progress & Circular Ring */
.hud-progress-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.orbit-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.orbit-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.orbit-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.orbit-ring-fill {
  stroke: url(#orbitGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.7));
}

.orbit-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  direction: ltr;
}

.hud-progress-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hud-completed-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
  direction: ltr;
  text-align: right;
}

.hud-completed-title span.completed-num {
  color: #34d399;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.hud-remaining-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
}

.hud-status-message {
  font-size: 0.78rem;
  font-weight: 700;
  color: #c084fc;
}

/* Card 3: Year Flight Status */
.hud-year-summary-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hud-year-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-year-badge {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.hud-year-ratio {
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
  direction: ltr;
}

.hud-year-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.hud-year-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

/* ==========================================================================
   Year Selector Navigator (Orbit Tabs)
   ========================================================================== */

.orbit-tabs-wrapper {
  position: relative;
  width: 100%;
}

.orbit-tabs-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1rem 0.25rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.orbit-tabs-container::-webkit-scrollbar {
  display: none;
}

.orbit-year-tab {
  flex: 1;
  min-width: 165px;
  padding: 1rem 1.15rem;
  background: rgba(15, 21, 44, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.orbit-year-tab:hover {
  background: rgba(22, 30, 60, 0.8);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.orbit-year-tab.active {
  background: linear-gradient(145deg, rgba(30, 39, 80, 0.9), rgba(15, 21, 45, 0.95));
  border-color: #38bdf8;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.35);
  transform: translateY(-3px) scale(1.02);
}

.tab-year-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-year-hours {
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
}

.tab-progress-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 0.25rem;
  direction: ltr;
}

.tab-badge-complete {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 0.75rem;
  color: #34d399;
  filter: drop-shadow(0 0 6px #34d399);
}

/* ==========================================================================
   Semesters & Courses Orbit Display Area
   ========================================================================== */

.semesters-display-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: flightFadeIn 0.35s ease-out;
}

@keyframes flightFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.semester-cosmic-card {
  background: rgba(13, 17, 36, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  transition: border-color 0.3s ease;
}

.semester-cosmic-card:hover {
  border-color: rgba(139, 92, 246, 0.45);
}

/* Semester Header */
.semester-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  background: rgba(20, 27, 56, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 1rem;
}

.semester-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.semester-icon {
  font-size: 1.4rem;
  color: #c084fc;
}

.semester-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
}

.semester-hours-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c084fc;
  border-radius: 9999px;
}

.semester-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.semester-progress-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  direction: ltr;
}

.btn-toggle-all-semester {
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-all-semester:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

/* Courses Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
  padding: 1.5rem;
}

/* Individual Course Row / Card */
.course-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  gap: 0.85rem;
}

.course-card-item:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.course-card-item.completed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.12);
}

.course-left-col {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

/* Custom Cosmic Checkbox */
.cosmic-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 20, 40, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: transparent;
  font-size: 0.75rem;
  font-weight: 800;
}

.course-card-item:hover .cosmic-checkbox {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.course-card-item.completed .cosmic-checkbox {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: #34d399;
  color: #042f2e;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
  transform: scale(1.05);
}

.course-info-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.course-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.4;
  word-break: break-word;
}

.course-card-item.completed .course-name {
  color: #cbd5e1;
}

.course-status-pill {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.course-card-item.completed .course-status-pill {
  color: #34d399;
  font-weight: 700;
}

/* Hours Badge */
.course-hours-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  white-space: nowrap;
  flex-shrink: 0;
  direction: rtl;
}

.course-card-item.completed .course-hours-pill {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34d399;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .flight-path-header {
    padding: 0.85rem 1rem;
  }
  .flight-path-body {
    padding: 1.25rem 1rem 4rem 1rem;
    gap: 1.25rem;
  }
  .courses-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .semester-card-header {
    padding: 1rem;
  }
}
