@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800;900&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  
  --bg-page: #f5f7fa;
  --bg-tint: rgba(56, 189, 248, 0.08);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-soft: #fafbfc;
  --text-main: #1a202c;
  --text-soft: #718096;
  --line: rgba(226, 232, 240, 0.8);
  --line-strong: rgba(203, 213, 225, 0.9);
  --shadow-1: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.04);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 76px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a202c;
  --sidebar-soft: #718096;
  --sidebar-border: rgba(226, 232, 240, 0.8);
  
  
  --year-1: #ff6b35;
  --year-2: #2196f3;
  --year-3: #10b981;
  --year-4: #9333ea;
  --year-5: #ec4899;
  --year-6: #06b6d4;
  
  
  --planner-color: #ff6b35;
  --drives-color: #2196f3;
  --pratique-color: #10b981;
  --sources-color: #f59e0b;
  --residanat-color: #8b5cf6;
  
  
  --cours: #e3f2fd;
  --resum: #e8f5e9;
  --notes: #fff3e0;
  --videos: #fce4ec;
}

[data-theme="dark"] {
  
  --bg-page: #0a1628;
  --bg-tint: rgba(37, 99, 235, 0.1);
  --surface: rgba(15, 32, 56, 0.6);
  --surface-solid: #0f2038;
  --surface-soft: #0d1829;
  --text-main: #e2e8f0;
  --text-soft: #94a3b8;
  --line: rgba(51, 65, 85, 0.6);
  --line-strong: rgba(71, 85, 105, 0.8);
  --shadow-1: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.2);
  --sidebar-bg: #0d1829;
  --sidebar-text: #e2e8f0;
  --sidebar-soft: #94a3b8;
  --sidebar-border: rgba(51, 65, 85, 0.6);
  
  
  --cours: rgba(37, 99, 235, 0.15);
  --resum: rgba(16, 185, 129, 0.15);
  --notes: rgba(245, 158, 11, 0.15);
  --videos: rgba(236, 72, 153, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

#module-app {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
}

body {
  font-family: "Plus Jakarta Sans", "Manrope", "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-main);
  background:
    radial-gradient(circle at 100% 0%, var(--bg-tint), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(59, 130, 246, 0.1), transparent 45%),
    var(--bg-page);
}

button,
input,
textarea,
select,
a {
  font-family: inherit;
}

.layout {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(235, 241, 250, 0.98), rgba(241, 245, 249, 0.98));
  margin: 0;
  padding: 0;
  display: flex;
}

.sidebar-open-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(145deg, #0a1d3d, #114d8c);
  color: #eff6ff;
  font-size: 18px;
  line-height: 1;
  display: none;
  place-items: center;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 14px 26px rgba(3, 12, 28, 0.45);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  min-height: calc(1cm + env(safe-area-inset-bottom));
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.mobile-bottom-nav-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: visible;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
}

.mobile-bottom-nav-track::-webkit-scrollbar {
  display: none;
}

.mobile-bottom-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mobile-bottom-btn:hover,
.mobile-bottom-btn:active {
  background: #1a1a1a;
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.mobile-bottom-btn i {
  color: #ffffff;
  font-size: 14px;
}

.mobile-bottom-btn img {
  pointer-events: none;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.mobile-bottom-avatar,
.mobile-bottom-logo {
  padding: 0;
  background: #000000;
}

.mobile-bottom-avatar img,
.mobile-bottom-logo img {
  filter: none;
  border-radius: 50%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(125, 211, 252, 0.2), transparent 38%),
    radial-gradient(circle at 95% 100%, rgba(30, 64, 175, 0.24), transparent 45%),
    var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 0;
  font-size: 12px;
  transition: transform 0.28s ease;
  z-index: 30;
  box-shadow: none;
}

.sidebar * {
  line-height: 1.14;
}

.sidebar::-webkit-scrollbar {
  width: 7px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(191, 219, 254, 0.38);
  border-radius: 999px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 6px;
  border-bottom: none;
}

.sidebar-account-card,
.sidebar-module-card,
.sidebar-brand-card {
  position: relative;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 3px 0 5px;
  box-shadow: none;
}

.sidebar-brand-card {
  order: 1;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(191, 219, 254, 0.18);
}

.sidebar-account-card {
  order: 2;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: none;
}

.sidebar-account-card,
.sidebar-module-card,
.sidebar-brand-card {
  margin-bottom: 2px;
}

.sidebar-module-card {
  display: none !important;
}

.sidebar-account-card::after,
.sidebar-module-card::after,
.sidebar-brand-card::after {
  content: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(191, 219, 254, 0.32);
  border-radius: 999px;
}

.sidebar-account-head,
.sidebar-module-head,
.sidebar-brand-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sidebar-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(191, 219, 254, 0.5);
  flex: 0 0 28px;
}

.sidebar-module-avatar-shell {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(191, 219, 254, 0.68);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.92);
  flex: 0 0 28px;
}

.sidebar-module-avatar {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  object-fit: cover;
  border: none;
}

.sidebar-account-name {
  margin: 0;
  font-size: 0.69rem;
  font-weight: 800;
  color: var(--sidebar-text);
}

.sidebar-account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-account-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sidebar-account-row-top {
  justify-content: space-between;
}

.sidebar-account-links {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  white-space: normal;
}

.sidebar-account-link {
  text-decoration: none;
  color: #dbeafe;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(147, 197, 253, 0.34);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.2);
  transition: all 0.2s ease;
}

.sidebar-account-link-fb {
  flex-shrink: 0;
}

.sidebar-account-link:hover {
  background: rgba(30, 58, 138, 0.42);
  color: #ffffff;
}

.sidebar-module-copy {
  min-width: 0;
}

.sidebar-module-title {
  margin: 0;
  font-size: 0.56rem;
  color: color-mix(in srgb, var(--sidebar-soft) 88%, #334155 12%);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}

.sidebar-module-subtitle {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.05;
  font-weight: 800;
  color: var(--sidebar-text);
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-brand-head {
  justify-content: space-between;
}

.sidebar-brand-logo-shell {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.85);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  flex: 0 0 28px;
}

.sidebar-brand-logo {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  object-fit: cover;
  border: none;
}

.sidebar-brand-name {
  margin: 0 auto 0 0;
  font-size: 1.03rem;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 800;
  color: #ffffff;
}

.sidebar-brand-subtitle {
  margin: 1px 0 0;
  font-size: 0.53rem;
  line-height: 1.05;
  color: var(--sidebar-soft);
  font-weight: 700;
}

.sidebar-home-link {
  order: 3;
  width: 100%;
  min-height: 34px;
  margin-top: 0;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #eaf2ff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.22);
  transition: all 0.2s ease;
}

.sidebar-home-link:hover {
  color: #ffffff;
  border-color: rgba(191, 219, 254, 0.72);
  background: rgba(30, 58, 138, 0.52);
}

.sidebar-home-link span:first-child {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1;
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-app-nav {
  display: grid;
  gap: 4px;
  padding: 0 14px 10px;
  margin-top: 0;
}

.sidebar-pages-section {
  margin: 0 0 12px 0;
  border: none;
  padding: 0 7px;
}

.sidebar-pages-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: all 0.2s;
}

.sidebar-pages-header:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.sidebar-pages-header span:first-child {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-pages-header span:first-child i {
  color: #ffffff;
}

.sidebar-pages-header span:nth-child(2) {
  flex: 1;
}

.sidebar-pages-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.sidebar-pages-section[open] .sidebar-pages-arrow {
  transform: rotate(180deg);
}

.sidebar-pages-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0 0 0;
}

.sidebar-page-link {
  width: 100%;
  min-height: 32px;
  text-decoration: none;
  color: var(--sidebar-soft);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.sidebar-page-link:hover {
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-page-link span:first-child {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-page-link span:first-child i {
  color: #ffffff;
}

.sidebar-app-link {
  width: 100%;
  min-height: 34px;
  text-decoration: none;
  color: #eaf2ff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.2s ease;
}

.sidebar-app-link:hover {
  color: #ffffff;
  border-color: rgba(191, 219, 254, 0.72);
  background: rgba(30, 58, 138, 0.52);
}

.sidebar-app-link span:first-child {
  width: 18px;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1;
  color: #8a8884;
}

.sidebar-app-link:hover span:first-child,
.sidebar-home-link:hover span:first-child {
  color: #bfdbfe;
}

.sidebar-tools {
  margin-top: 0;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.sidebar-tool-btn {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(147, 197, 253, 0.4);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.34);
  color: #eff6ff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0;
  text-align: center;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.sidebar-tool-btn:hover {
  border-color: rgba(191, 219, 254, 0.65);
  background: rgba(30, 58, 138, 0.52);
  color: #ffffff;
}

.sidebar-tool-btn span {
  pointer-events: none;
}

.sidebar-tools .danger {
  background: rgba(15, 23, 42, 0.34);
  color: #eff6ff;
  border-color: rgba(147, 197, 253, 0.4);
}

.sidebar-tools .danger:hover {
  background: rgba(30, 58, 138, 0.52);
  border-color: rgba(191, 219, 254, 0.65);
  color: #ffffff;
}

.sidebar-years {
  padding: 3px 8px 8px;
}

.sidebar-year {
  border: none;
  border-bottom: 1px solid rgba(191, 219, 254, 0.25);
  border-radius: 0;
  background: transparent;
  margin-bottom: 4px;
  padding-bottom: 2px;
  overflow: hidden;
}

.sidebar-year summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.sidebar-year summary::-webkit-details-marker {
  display: none;
}

.sidebar-year-badge {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 0.58rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, var(--year-start), var(--year-end));
  flex: 0 0 20px;
}

.sidebar-year-title {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #eaf2ff;
}

.sidebar-year-count {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--sidebar-soft);
}

.sidebar-module-list {
  padding: 4px 0 2px 0;
  display: grid;
  gap: 2px;
}

.sidebar-module-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-radius: 7px;
  padding: 5px 8px;
  background: transparent;
  transition: all 0.2s ease;
}

.sidebar-module-link:hover {
  background: rgba(15, 23, 42, 0.28);
  color: #ffffff;
}

.sidebar-module-link.active {
  background: rgba(37, 99, 235, 0.3);
  color: #ffffff;
  font-weight: 900;
  border-radius: 7px;
}

.sidebar-module-link img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex: 0 0 16px;
}

.content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  padding: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(235, 241, 250, 0.98), rgba(241, 245, 249, 0.98)),
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.1), transparent 28%);
  border-left: 0;
  box-shadow: none;
  transition: margin-left 0.28s ease, width 0.28s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.content > :first-child {
  margin-top: 0 !important;
}

.content::before {
  display: none !important;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(0);
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .content {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

body.sidebar-collapsed .sidebar-open-btn {
  display: grid;
}

body.sidebar-collapsed .sidebar {
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-top {
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-account-head,
body.sidebar-collapsed .sidebar-module-head,
body.sidebar-collapsed .sidebar-brand-head,
body.sidebar-collapsed .sidebar-year summary,
body.sidebar-collapsed .sidebar-module-link,
body.sidebar-collapsed .sidebar-home-link {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-account-copy,
body.sidebar-collapsed .sidebar-module-copy,
body.sidebar-collapsed .sidebar-brand-name,
body.sidebar-collapsed .sidebar-home-link span:last-child,
body.sidebar-collapsed .sidebar-app-link span:last-child,
body.sidebar-collapsed .sidebar-page-link span:last-child,
body.sidebar-collapsed .sidebar-year-title,
body.sidebar-collapsed .sidebar-year-count,
body.sidebar-collapsed .sidebar-module-link span {
  display: none;
}

body.sidebar-collapsed .sidebar-tools {
  display: none;
}

body.sidebar-collapsed .sidebar-account-links {
  display: none;
}

body.sidebar-collapsed .sidebar-app-nav {
  padding: 0 8px 12px;
}

body.sidebar-collapsed .sidebar-pages-section {
  padding: 0 8px 12px;
}

body.sidebar-collapsed .sidebar-page-link {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
}

body.sidebar-collapsed .sidebar-module-list {
  display: grid;
  justify-items: center;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-module-link {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

body.sidebar-collapsed .sidebar-module-link img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

body.sidebar-collapsed .sidebar-app-link {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
}

body.sidebar-collapsed .sidebar-year summary {
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-year-badge {
  margin: 0;
}

.hero {
  position: relative;
  top: auto;
  z-index: 1;
  margin-top: 0;
  min-height: 0;
  background: linear-gradient(180deg, rgba(10, 29, 61, 0.96), rgba(17, 77, 140, 0.94));
  border: 0;
  border-bottom: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 0;
  padding: 16px 14px;
  box-shadow: none;
  overflow: visible;
}

.hero::before,
.hero::after {
  content: none;
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 0;
}


.hero-stats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(191, 219, 254, 0.2);
  flex-wrap: wrap;
  width: 100%;
}

.hero-stat-item {
  flex: 1 1 auto;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.hero-stat-item:hover {
  background: rgba(30, 58, 138, 0.4);
  border-color: rgba(191, 219, 254, 0.5);
  transform: translateY(-2px);
}

.hero-stat-item-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.25));
  border-color: rgba(96, 165, 250, 0.5);
}

.hero-stat-item-highlight:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.35));
  border-color: rgba(147, 197, 253, 0.7);
}

.hero-stat-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  filter: grayscale(100%) brightness(200%);
}

.hero-stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-stat-value {
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--sidebar-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

@media (max-width: 768px) {
  .hero-stats {
    gap: 6px;
  }
  
  .hero-stat-item {
    min-width: calc(25% - 5px);
    padding: 6px 10px;
  }
  
  .hero-stat-icon {
    font-size: 1rem;
  }
  
  .hero-stat-value {
    font-size: 0.9rem;
  }
  
  .hero-stat-label {
    font-size: 0.52rem;
  }
}


.file-item-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.file-item-wrapper:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.file-item-name {
  flex: 1;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.file-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.file-action-btn {
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 0.55rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.file-action-open {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

.file-action-open:hover {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border-color: rgba(59, 130, 246, 0.5);
}

.file-action-download {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: rgba(34, 197, 94, 0.3);
  color: #166534;
}

.file-action-download:hover {
  background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
  border-color: rgba(34, 197, 94, 0.5);
}

.file-action-copy {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.file-action-copy:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  border-color: rgba(245, 158, 11, 0.5);
}


.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 360px;
}

.hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(219, 234, 254, 0.88);
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(6, 19, 38, 0.22);
}

.hero-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.9vw, 1.45rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text-main);
}

.hero-chips {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(191, 219, 254, 0.5);
  border-radius: 999px;
  padding: 3px 10px;
  color: #eff6ff;
  background: rgba(15, 23, 42, 0.24);
  font-size: 0.62rem;
  font-weight: 800;
}

.hero-tools {
  width: min(560px, 100%);
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 1 1 420px;
}

.hero-search-wrap {
  flex: 1 1 260px;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: rgba(248, 251, 255, 0.97);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 22px -18px rgba(8, 22, 48, 0.45);
}

.hero-search-input {
  min-height: 40px;
}

.search-input::placeholder {
  color: #7488a8;
}

.search-input:focus {
  outline: 2px solid rgba(125, 211, 252, 0.36);
  border-color: rgba(59, 130, 246, 0.62);
}

.hero-btn {
  border: 1px solid rgba(191, 219, 254, 0.55);
  background: rgba(15, 23, 42, 0.26);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #eff6ff;
  text-decoration: none;
  box-shadow: 0 10px 16px -18px rgba(7, 25, 51, 0.8);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-btn:hover {
  border-color: rgba(191, 219, 254, 0.8);
  color: #ffffff;
  background: rgba(15, 23, 42, 0.42);
}

.hero-btn.primary {
  border-color: rgba(125, 211, 252, 0.8);
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #ffffff;
}

.hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.page-section {
  margin-top: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 3px 14px;
  box-shadow: none;
  backdrop-filter: none;
}

.section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
}

.section-subtitle {
  margin: 2px 0 0;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-soft);
}

.groups-list {
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.lesson-group {
  --group-accent: #0ea5e9;
  --group-soft: #eff8ff;
  border: 1px solid rgba(148, 163, 184, 0.33);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--group-soft) 0%, #ffffff 82%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.lesson-group:nth-of-type(6n + 1) {
  --group-accent: #0ea5e9;
  --group-soft: #eff8ff;
}

.lesson-group:nth-of-type(6n + 2) {
  --group-accent: #22c55e;
  --group-soft: #f0fdf4;
}

.lesson-group:nth-of-type(6n + 3) {
  --group-accent: #f59e0b;
  --group-soft: #fff7ed;
}

.lesson-group:nth-of-type(6n + 4) {
  --group-accent: #ef4444;
  --group-soft: #fff1f2;
}

.lesson-group:nth-of-type(6n + 5) {
  --group-accent: #8b5cf6;
  --group-soft: #f5f3ff;
}

.lesson-group:nth-of-type(6n + 6) {
  --group-accent: #14b8a6;
  --group-soft: #f0fdfa;
}

.group-header {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
}

.group-header::-webkit-details-marker {
  display: none;
}

.group-index {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.57rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, var(--group-accent), #1e3a8a);
  background: linear-gradient(135deg, var(--group-accent), color-mix(in srgb, var(--group-accent) 55%, #111827 45%));
  flex: 0 0 22px;
}

.group-copy {
  min-width: 0;
  flex: 1;
}

.group-title {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
  color: color-mix(in srgb, var(--group-accent) 34%, #0f172a 66%);
}

.group-subtitle {
  margin: 1px 0 0;
  font-size: 0.6rem;
  color: #71839b;
  font-weight: 700;
}

.group-count {
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.58rem;
  font-weight: 800;
  color: #334155;
  color: color-mix(in srgb, var(--group-accent) 45%, #1e293b 55%);
}

.group-body {
  padding: 0 8px 8px;
}

.lesson-item {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.33);
  border: 1px solid color-mix(in srgb, var(--group-accent) 24%, rgba(148, 163, 184, 0.4));
  border-left: 3px solid var(--group-accent);
  border-radius: 10px;
  background: var(--surface-solid);
  padding: 7px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.lesson-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.lesson-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: wrap;
  overflow-x: auto;
  margin-left: 0;
  width: 100%;
  scrollbar-width: none;
}

.lesson-actions::-webkit-scrollbar {
  display: none;
}

.lesson-tab {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-left-width: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  color: #334155;
  font-size: 0.54rem;
  font-weight: 900;
  min-height: 30px;
  padding: 0 10px 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.lesson-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.lesson-tab:active {
  transform: translateY(0);
  box-shadow: none;
}

.lesson-tab:focus,
.lesson-tab:focus-visible {
  transform: none;
  box-shadow: none;
  outline: none;
}

.lesson-tab-icon {
  display: none !important;
}

.lesson-tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.lesson-tab.active[data-type="cours"] {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border-color: rgba(2, 132, 199, 0.34);
  color: #075985;
}

.lesson-tab.active[data-type="resum"] {
  background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
  border-color: rgba(22, 163, 74, 0.3);
  color: #166534;
}

.lesson-tab.active[data-type="notes"] {
  background: linear-gradient(135deg, #ffe4e6 0%, #ffe8f1 100%);
  border-color: rgba(244, 63, 94, 0.28);
  color: #be123c;
}

.lesson-tab.active[data-type="videos"] {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: rgba(202, 138, 4, 0.28);
  color: #92400e;
}

.lesson-tab.active[data-type="ai"] {
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  border-color: rgba(79, 70, 229, 0.28);
  color: #4338ca;
}

.lesson-tab.active[data-type="coursimprimables"] {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  border-color: rgba(251, 146, 60, 0.34);
  color: #c2410c;
}

.lesson-tab.active[data-type="mindmap"] {
  background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
  border-color: rgba(168, 85, 247, 0.34);
  color: #7e22ce;
}

.lesson-tab.active[data-type="qcmsparcours"] {
  background: linear-gradient(135deg, #a5f3fc 0%, #67e8f9 100%);
  border-color: rgba(6, 182, 212, 0.34);
  color: #0e7490;
}

.lesson-tab.active[data-type="guides"] {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  border-color: rgba(245, 158, 11, 0.34);
  color: #92400e;
}

.lesson-tab.active[data-type="programmes"] {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border-color: rgba(59, 130, 246, 0.34);
  color: #1e40af;
}

.lesson-tab.active[data-type="qcms"] {
  background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%);
  border-color: rgba(236, 72, 153, 0.34);
  color: #9f1239;
}

.lesson-tab.active[data-type="examens"] {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  border-color: rgba(239, 68, 68, 0.34);
  color: #991b1b;
}

.lesson-tab.active[data-type="livresdz"] {
  background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
  border-color: rgba(99, 102, 241, 0.34);
  color: #3730a3;
}

.lesson-tab.active[data-type="livresfr"] {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  border-color: rgba(16, 185, 129, 0.34);
  color: #065f46;
}

.lesson-tab.active[data-type="sources"] {
  background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
  border-color: rgba(107, 114, 128, 0.34);
  color: #374151;
}

.lesson-tab.active[data-type="drive1"],
.lesson-tab.active[data-type="drive2"],
.lesson-tab.active[data-type="drive3"],
.lesson-tab.active[data-type="drive4"],
.lesson-tab.active[data-type="drive5"],
.lesson-tab.active[data-type="drive6"] {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border-color: rgba(59, 130, 246, 0.34);
  color: #1e40af;
}

.lesson-tab.active[data-type="fichesobservation"] {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  border-color: rgba(16, 185, 129, 0.34);
  color: #065f46;
}

.lesson-tab.active[data-type="cats"],
.lesson-tab.active[data-type="dossiers"] {
  background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
  border-color: rgba(245, 158, 11, 0.34);
  color: #92400e;
}

.lesson-tab.active[data-type="temoignages"],
.lesson-tab.active[data-type="sujets"] {
  background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 100%);
  border-color: rgba(139, 92, 246, 0.34);
  color: #5b21b6;
}

.lesson-tab[data-type="cours"] {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left-color: #0ea5e9;
  color: #075985;
}

.lesson-tab[data-type="resum"] {
  background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
  border-left-color: #22c55e;
  color: #166534;
}

.lesson-tab[data-type="notes"] {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-left-color: #f43f5e;
  color: #be123c;
}

.lesson-tab[data-type="videos"] {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: #f59e0b;
  color: #92400e;
}

.lesson-tab[data-type="ai"] {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-left-color: #6366f1;
  color: #4338ca;
}

.lesson-tab[data-type="coursimprimables"] {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left-color: #fb923c;
  color: #c2410c;
}

.lesson-tab[data-type="mindmap"] {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-left-color: #a855f7;
  color: #7e22ce;
}

.lesson-tab[data-type="qcmsparcours"] {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-left-color: #06b6d4;
  color: #0e7490;
}

.lesson-tab[data-type="guides"] {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left-color: #f59e0b;
  color: #92400e;
}

.lesson-tab[data-type="programmes"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left-color: #3b82f6;
  color: #1e40af;
}

.lesson-tab[data-type="qcms"] {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-left-color: #ec4899;
  color: #9f1239;
}

.lesson-tab[data-type="examens"] {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left-color: #ef4444;
  color: #991b1b;
}

.lesson-tab[data-type="livresdz"] {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-left-color: #6366f1;
  color: #3730a3;
}

.lesson-tab[data-type="livresfr"] {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left-color: #10b981;
  color: #065f46;
}

.lesson-tab[data-type="sources"] {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border-left-color: #6b7280;
  color: #374151;
}

.lesson-tab[data-type="drive1"],
.lesson-tab[data-type="drive2"],
.lesson-tab[data-type="drive3"],
.lesson-tab[data-type="drive4"],
.lesson-tab[data-type="drive5"],
.lesson-tab[data-type="drive6"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left-color: #3b82f6;
  color: #1e40af;
}

.lesson-tab[data-type="fichesobservation"] {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left-color: #10b981;
  color: #065f46;
}

.lesson-tab[data-type="cats"],
.lesson-tab[data-type="dossiers"] {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  border-left-color: #f59e0b;
  color: #92400e;
}

.lesson-tab[data-type="temoignages"],
.lesson-tab[data-type="sujets"] {
  background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
  border-left-color: #8b5cf6;
  color: #5b21b6;
}


.lesson-tab:nth-child(6n + 1) {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left-color: #fca5a5;
  color: #dc2626;
}

.lesson-tab:nth-child(6n + 2) {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left-color: #86efac;
  color: #16a34a;
}

.lesson-tab:nth-child(6n + 3) {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left-color: #fca5a5;
  color: #dc2626;
}

.lesson-tab:nth-child(6n + 4) {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border-left-color: #fde047;
  color: #ca8a04;
}

.lesson-tab:nth-child(6n + 5) {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left-color: #fdba74;
  color: #ea580c;
}

.lesson-tab:nth-child(6n + 6) {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left-color: #93c5fd;
  color: #2563eb;
}


.lesson-tab.active:nth-child(6n + 1) {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.lesson-tab.active:nth-child(6n + 2) {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

.lesson-tab.active:nth-child(6n + 3) {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.lesson-tab.active:nth-child(6n + 4) {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: rgba(245, 158, 11, 0.3);
  color: #ca8a04;
}

.lesson-tab.active:nth-child(6n + 5) {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: rgba(249, 115, 22, 0.3);
  color: #ea580c;
}

.lesson-tab.active:nth-child(6n + 6) {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

.resource-panel[data-type="ai"] {
  border: 1px solid rgba(147, 197, 253, 0.42);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.94), rgba(248, 250, 252, 0.98));
  padding: 8px;
}

.ai-resource-link {
  display: block;
  border-left: 4px solid #4f46e5;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(244, 247, 255, 0.96));
  box-shadow: none;
}

.ai-resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-resource-title {
  font-size: 0.62rem;
  font-weight: 900;
  color: #0f172a;
}

.ai-resource-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ai-resource-action {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 900;
  border: 1px solid transparent;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  box-shadow: none;
}

.ai-resource-action.chatgpt {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(59, 130, 246, 0.22));
  border-color: rgba(37, 99, 235, 0.26);
  color: #1d4ed8;
  box-shadow: none;
}

.ai-resource-action.claude {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.08), rgba(71, 85, 105, 0.18));
  border-color: rgba(30, 41, 59, 0.22);
  color: #111827;
  box-shadow: none;
}

.resource-panels {
  margin-top: 6px;
}

.resource-panel {
  display: none;
  gap: 4px;
}

.resource-panel.active {
  display: grid;
}

.resource-link {
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  color: #334155;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 6px 10px;
  min-height: 32px;
  line-height: 1.16;
  box-shadow: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.resource-link:hover {
  border-color: color-mix(in srgb, var(--group-accent) 58%, #3b82f6 42%);
  background: #ffffff;
  background: color-mix(in srgb, var(--group-soft) 55%, #ffffff 45%);
  transform: none;
  box-shadow: none;
}

.resource-link:active,
.resource-link:focus,
.resource-link:focus-visible,
.ai-resource-link:hover,
.ai-resource-link:active,
.ai-resource-link:focus,
.ai-resource-link:focus-visible,
.ai-resource-action:hover,
.ai-resource-action:active,
.ai-resource-action:focus,
.ai-resource-action:focus-visible {
  transform: none;
  box-shadow: none;
  outline: none;
}

body.dark-mode {
  --bg-page: #020617;
  --bg-tint: rgba(56, 189, 248, 0.08);
  --surface: rgba(15, 23, 42, 0.82);
  --surface-solid: #0f172a;
  --surface-soft: #111827;
  --text-main: #e2e8f0;
  --text-soft: #bfd0e3;
  --line: rgba(100, 116, 139, 0.42);
  --line-strong: rgba(148, 163, 184, 0.55);
  --sidebar-bg: linear-gradient(180deg, #081127 0%, #0b2248 52%, #10396a 100%);
  --sidebar-text: #f8fafc;
  --sidebar-soft: rgba(226, 232, 240, 0.72);
}

body.dark-mode .hero {
  background: linear-gradient(180deg, #050f22 0%, #0a2450 52%, #0d3f7a 100%);
  border-bottom-color: rgba(147, 197, 253, 0.28);
}

body.dark-mode .layout {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.98));
}

body.dark-mode .content {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.96)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30%);
  border-left-color: transparent;
  box-shadow: none;
}

body.dark-mode .page-section,
body.dark-mode .lesson-item,
body.dark-mode .resource-link,
body.dark-mode .group-count {
  background: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .hero-chip {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.36);
  border-color: rgba(147, 197, 253, 0.55);
}

body.dark-mode .lesson-group {
  background: #111827;
}

body.dark-mode .sidebar-account-card,
body.dark-mode .sidebar-module-card,
body.dark-mode .sidebar-brand-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.dark-mode .sidebar-account-card::after,
body.dark-mode .sidebar-module-card::after,
body.dark-mode .sidebar-brand-card::after {
  background: rgba(148, 163, 184, 0.48);
}

body.dark-mode .sidebar-year {
  background: transparent;
  border-bottom-color: rgba(148, 163, 184, 0.42);
}

body.dark-mode .sidebar-module-link {
  background: transparent;
}

body.dark-mode .sidebar-account-name,
body.dark-mode .sidebar-module-subtitle,
body.dark-mode .sidebar-brand-name,
body.dark-mode .sidebar-year-title,
body.dark-mode .sidebar-module-link,
body.dark-mode .sidebar-account-link,
body.dark-mode .sidebar-tool-btn {
  color: #e2e8f0;
}

body.dark-mode .sidebar-account-link {
  background: rgba(15, 23, 42, 0.28);
  border-color: rgba(148, 163, 184, 0.28);
}

body.dark-mode .sidebar-tool-btn {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(148, 163, 184, 0.4);
}

body.dark-mode .sidebar-brand-logo-shell {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .sidebar-app-link {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.3);
}

body.dark-mode .sidebar-brand-card,
body.dark-mode .sidebar-account-card {
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .sidebar-module-avatar-shell {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .sidebar-tool-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #dbeafe;
}

body.dark-mode .sidebar-tools .danger {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

body.dark-mode .sidebar-tools .danger:hover {
  background: rgba(127, 29, 29, 0.55);
  color: #fee2e2;
}

body.dark-mode .sidebar-account-link:hover,
body.dark-mode .sidebar-module-link:hover,
body.dark-mode .sidebar-module-link.active,
body.dark-mode .sidebar-app-link:hover {
  color: #ffffff;
}

body.dark-mode .sidebar-module-link:hover {
  background: rgba(15, 23, 42, 0.34);
}

body.dark-mode .sidebar-app-link:hover {
  background: rgba(15, 23, 42, 0.34);
}

body.dark-mode .sidebar-module-link.active {
  background: rgba(30, 64, 175, 0.42);
}

body.dark-mode .search-input,
body.dark-mode .lesson-tab {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  color: #ffffff;
  border-color: rgba(100, 116, 139, 0.56);
}

body.dark-mode .lesson-tab.active {
  color: #60a5fa;
}

body.dark-mode .lesson-tab:hover {
  color: #bfdbfe;
}

body.dark-mode .hero-search-input {
  background: rgba(2, 6, 23, 0.64);
  color: #f8fafc;
  border-color: rgba(147, 197, 253, 0.4);
}

body.dark-mode .hero-search-input::placeholder {
  color: rgba(186, 211, 243, 0.9);
}

body.dark-mode .hero-btn {
  background: rgba(15, 23, 42, 0.42);
  color: #eff6ff;
  border-color: rgba(147, 197, 253, 0.5);
}

body.dark-mode .hero-btn.primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
}

body.dark-mode .lesson-tab.active[data-type="ai"] {
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.68), rgba(30, 64, 175, 0.5));
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.42);
}

body.dark-mode .resource-panel[data-type="ai"] {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.98));
  border-color: rgba(96, 165, 250, 0.45);
}

body.dark-mode .ai-resource-link {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.94));
  color: #dbeafe;
  border-left-color: #60a5fa;
}

body.dark-mode .ai-resource-title {
  color: #dbeafe;
}

body.dark-mode .ai-resource-action.chatgpt {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.28));
  border-color: rgba(96, 165, 250, 0.34);
  color: #bfdbfe;
}

body.dark-mode .ai-resource-action.claude {
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.2), rgba(148, 163, 184, 0.16));
  border-color: rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
}

body.dark-mode .group-title,
body.dark-mode .lesson-title {
  color: #e2e8f0;
}

body.dark-mode .group-subtitle,
body.dark-mode .section-subtitle {
  color: #aac0d7;
}

body.dark-mode .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.98);
  border-top-color: rgba(148, 163, 184, 0.24);
}

body.dark-mode .mobile-bottom-btn {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15);
}

body.dark-mode .mobile-bottom-btn:hover,
body.dark-mode .mobile-bottom-btn:active {
  background: #f0f0f0;
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.25);
}

body.dark-mode .mobile-bottom-btn i {
  color: #000000;
}

body.dark-mode .mobile-bottom-btn img {
  filter: brightness(0);
}

body.dark-mode .mobile-bottom-avatar,
body.dark-mode .mobile-bottom-logo {
  background: #ffffff;
}

body.dark-mode .mobile-bottom-avatar img,
body.dark-mode .mobile-bottom-logo img {
  filter: none;
}

body.dark-mode .mobile-bottom-btn {
  color: #e2e8f0;
}

body.dark-mode .mobile-bottom-btn:hover,
body.dark-mode .mobile-bottom-btn:active {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, 0.3);
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 7cm;
  }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content,
  body.sidebar-collapsed .content {
    margin-left: 0;
    width: 100%;
    padding-top: 0;
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .hero-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .hero-tools {
    width: 100%;
    margin-left: 0;
  }

  .sidebar-open-btn {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
  }
}

@media (max-width: 760px) {
  .lesson-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .lesson-title {
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.26;
  }

  .lesson-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 4px;
  }

  .lesson-tab {
    min-height: 26px;
    padding: 0 8px 0 6px;
    font-size: 0.49rem;
  }
}

@media (max-width: 620px) {
  .hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .hero-title {
    font-size: 0.96rem;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .hero-btn {
    flex: 1;
    text-align: center;
  }
}



.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 3000;
}

.preview-modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #dc2626;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(220, 38, 38, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.modal-close:hover {
  background: #991b1b;
  box-shadow: 0 12px 40px 0 rgba(153, 27, 27, 0.6);
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.modal-close:hover i {
  transform: rotate(90deg);
}

.modal-close:active {
  transform: translateY(0) scale(1);
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}


.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
