/* 
   Design System - Plataforma EAD
   Criado com base no arquivo DESIGN.md 
*/

:root {
  /* Colors */
  --color-surface: #f8f9ff;
  --color-surface-dim: #cbdbf5;
  --color-surface-bright: #f8f9ff;
  --color-surface-container-lowest: #ffffff;
  --color-surface-container-low: #eff4ff;
  --color-surface-container: #e5eeff;
  --color-surface-container-high: #dce9ff;
  --color-surface-container-highest: #d3e4fe;
  
  --color-on-surface: #0b1c30;
  --color-on-surface-variant: #424754;
  --color-inverse-surface: #213145;
  --color-inverse-on-surface: #eaf1ff;
  
  --color-outline: #727785;
  --color-outline-variant: #c2c6d6;
  
  --color-primary: #0058be;
  --color-on-primary: #ffffff;
  --color-primary-container: #2170e4;
  --color-on-primary-container: #fefcff;
  
  --color-secondary: #006c49;
  --color-on-secondary: #ffffff;
  --color-secondary-container: #6cf8bb;
  --color-on-secondary-container: #00714d;
  
  --color-tertiary: #825100;
  --color-on-tertiary: #ffffff;
  --color-tertiary-container: #a36700;
  
  --color-error: #ba1a1a;
  --color-on-error: #ffffff;
  
  --color-background: #f8f9ff;
  --color-on-background: #0b1c30;

  /* Typography Scale */
  --font-family: 'Inter', sans-serif;
  
  --text-display-lg-size: 48px;
  --text-display-lg-weight: 700;
  --text-display-lg-line-height: 56px;

  --text-headline-lg-size: 32px;
  --text-headline-lg-weight: 700;
  --text-headline-lg-line-height: 40px;

  --text-headline-md-size: 24px;
  --text-headline-md-weight: 600;
  --text-headline-md-line-height: 32px;

  --text-title-lg-size: 20px;
  --text-title-lg-weight: 600;
  --text-title-lg-line-height: 28px;

  --text-body-lg-size: 18px;
  --text-body-lg-weight: 400;
  --text-body-lg-line-height: 28px;

  --text-body-md-size: 16px;
  --text-body-md-weight: 400;
  --text-body-md-line-height: 24px;

  --text-label-md-size: 14px;
  --text-label-md-weight: 500;
  --text-label-md-line-height: 20px;

  --text-label-sm-size: 12px;
  --text-label-sm-weight: 600;
  --text-label-sm-line-height: 16px;

  /* Spacing Scale */
  --spacing-base: 4px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  --container-max: 1280px;
  --gutter: 24px;
  --sidebar-width: 280px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-default: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-level-1: 0px 1px 3px rgba(0,0,0,0.1);
  --shadow-level-2: 0px 10px 15px -3px rgba(0,0,0,0.1);
}

/* CSS Reset Minimalista */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-on-background);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-line-height);
  -webkit-font-smoothing: antialiased;
}

/* Typography Classes */
.display-lg { font-size: var(--text-display-lg-size); font-weight: var(--text-display-lg-weight); line-height: var(--text-display-lg-line-height); letter-spacing: -0.02em; }
.headline-lg { font-size: var(--text-headline-lg-size); font-weight: var(--text-headline-lg-weight); line-height: var(--text-headline-lg-line-height); letter-spacing: -0.01em; }
.headline-md { font-size: var(--text-headline-md-size); font-weight: var(--text-headline-md-weight); line-height: var(--text-headline-md-line-height); }
.title-lg { font-size: var(--text-title-lg-size); font-weight: var(--text-title-lg-weight); line-height: var(--text-title-lg-line-height); }
.label-md { font-size: var(--text-label-md-size); font-weight: var(--text-label-md-weight); line-height: var(--text-label-md-line-height); letter-spacing: 0.01em; }
.label-sm { font-size: var(--text-label-sm-size); font-weight: var(--text-label-sm-weight); line-height: var(--text-label-sm-line-height); letter-spacing: 0.05em; text-transform: uppercase; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-default);
  font-family: var(--font-family);
  font-size: var(--text-label-md-size);
  font-weight: var(--text-label-md-weight);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-container);
  box-shadow: var(--shadow-level-2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-surface-container);
}

/* Containers & Layout */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.card {
  background-color: var(--color-surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-level-1);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-level-2);
}

/* Progress Bar */
.progress-track {
  height: 8px;
  background-color: var(--color-surface-container-high);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
}

.progress-fill.completed {
  background-color: var(--color-secondary);
}

/* Layout Global - Dashboard (Mockup 2) */
.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: #f8f9fc;
}

/* Sidebar Global (Esquerda) */
.global-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 32px;
  text-decoration: none;
}
.brand-logo svg {
  width: 24px;
  height: 24px;
  color: #0d6efd;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.brand-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}
.nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.nav-item.active {
  background: #eff6ff;
  color: #0d6efd;
  border-left: 3px solid #0d6efd;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Área Principal (Meio e Direita) */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar Global */
.topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 16px;
  width: 300px;
}
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  margin-left: 8px;
  font-size: 14px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.live-badge {
  background: #ef4444;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Conteúdo Rolável */
.content-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Catalog Banner (Mockup 1) */
.catalog-banner {
  background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
}
.catalog-banner h1 {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}
.catalog-banner p {
  font-size: 16px;
  color: #475569;
  max-width: 600px;
}

/* Filters & Sort */
.filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.filter-pills {
  display: flex;
  gap: 12px;
}
.pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.pill.active {
  background: #0d6efd;
  color: #ffffff;
  border-color: #0d6efd;
}
.sort-dropdown {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 14px;
}

/* Cards do Catálogo */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.card-img-wrapper {
  position: relative;
  height: 180px;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Badges nas imagens */
.badge-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #f59e0b;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.badge-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.9);
  color: #0f172a;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.badge-bottom-left {
  position: absolute;
  bottom: -12px;
  left: 16px;
  background: #3b82f6;
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 2px solid white;
}

.card-body {
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.3;
}
.card-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
  flex-grow: 1;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-price {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.card-price span {
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
}

.btn-outline {
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #0d6efd;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mentorship Horizontal Card */
.mentorship-card {
  display: flex;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-top: 24px;
}
.mentorship-img {
  width: 300px;
  object-fit: cover;
  position: relative;
}
.mentorship-body {
  padding: 32px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.mentorship-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.mentorship-subtitle {
  font-size: 14px;
  color: #0d6efd;
  margin-bottom: 16px;
  font-weight: 500;
}
.mentorship-desc {
  font-size: 16px;
  color: #475569;
  max-width: 600px;
  margin-bottom: 32px;
  line-height: 1.5;
}
.mentorship-footer {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Player Layout Especifico (Mockup 2) */
.player-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.player-left {
  flex-grow: 1;
  min-width: 0; /* Impede overflow */
}
.player-right {
  width: 380px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 24px;
}

.breadcrumb {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 16px;
}
.breadcrumb span {
  color: #0f172a;
  font-weight: 600;
}

.video-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  margin-bottom: 16px;
}
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.video-overlay-title {
  position: absolute;
  bottom: 24px;
  left: 24px;
  color: white;
  font-size: 18px;
  font-weight: 600;
}
.video-overlay-time {
  position: absolute;
  bottom: 24px;
  right: 24px;
  color: white;
  font-size: 14px;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}
.lesson-nav a {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-banner {
  background: #0d6efd;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  margin-bottom: 24px;
}
.offer-banner h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.offer-banner p {
  font-size: 14px;
  opacity: 0.9;
}
.offer-banner .btn {
  background: white;
  color: #0d6efd;
  font-weight: 700;
  border-radius: 20px;
  padding: 8px 24px;
}

/* Tabs do Player */
.player-tabs {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.tabs-header {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
}
.tab-link {
  padding: 16px 24px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-link.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}
.tab-body {
  padding: 24px;
}

/* Sidebar do Curso (Direita) */
.course-progress-header {
  margin-bottom: 24px;
}
.course-progress-header h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #0f172a;
}
.progress-bar-bg {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: #0d6efd;
}
.progress-text {
  font-size: 12px;
  color: #64748b;
  text-align: right;
  display: block;
}

.module-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.module-header {
  padding: 16px;
  background: #f8f9fc;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}
.module-body {
  background: white;
}
.lesson-row {
  display: flex;
  padding: 12px 16px;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
  text-decoration: none;
  transition: background 0.2s;
}
.lesson-row:hover {
  background: #f8f9fc;
}
.lesson-row.active {
  background: #eff6ff;
}
.lesson-thumb {
  width: 80px;
  height: 50px;
  background: #333;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}
.lesson-thumb-time {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
}
.lesson-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lesson-title {
  font-size: 14px;
  font-weight: 600;
  color: #0d6efd;
  margin-bottom: 4px;
}
.lesson-row:not(.active) .lesson-title {
  color: #0f172a;
}
.lesson-status {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lesson-status.watched {
  color: #0d6efd;
}

.quiz-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  align-items: center;
  text-decoration: none;
  color: #475569;
}
.quiz-badge {
  background: #e0e7ff;
  color: #4f46e5;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Arquivos para Download */
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}
.file-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.file-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: #ef4444;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
}
.file-icon.excel { background: #dcfce7; color: #22c55e; }
.file-icon.audio { background: #fef3c7; color: #d97706; }
.file-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.file-size {
  font-size: 12px;
  color: #64748b;
}
.file-download {
  color: #64748b;
}

/* ==========================================================================
   Media Queries - Responsive Design (Mobile First / Desktop First)
   ========================================================================== */

.mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  /* Layout Base */
  .dashboard-layout {
    flex-direction: column;
  }
  
  .main-wrapper {
    width: 100%;
  }

  /* Overlay para Sidebar Aberta */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  .sidebar-overlay.show {
    display: block;
  }

  /* Global Sidebar como Off-canvas no Mobile */
  .global-sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Escondido fora da tela */
    width: 260px;
    height: 100vh;
    z-index: 999;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
  }
  
  .global-sidebar.sidebar-open {
    left: 0; /* Aparece na tela */
  }

  /* Topbar Mobile */
  .topbar {
    padding: 0 16px;
    height: 60px;
    justify-content: space-between;
  }
  
  .topbar .search-bar {
    display: none; /* No mobile ocultamos a barra de busca ou transformamos num ícone */
  }
  
  /* Botão Hamburger */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    background: none;
    border: none;
    color: #0f172a;
    cursor: pointer;
    padding: 4px;
    margin-right: 12px;
  }

  .topbar-actions {
    gap: 12px;
    margin-left: auto; /* Empurrar pra direita já que o hamburger tá na esquerda */
  }
  
  /* Content Area */
  .content-area {
    padding: 16px;
  }
  
  /* Catalog e Mentorship */
  .catalog-banner {
    padding: 24px 16px;
  }
  
  .catalog-banner h1 {
    font-size: 24px;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .filter-pills {
    flex-wrap: wrap;
  }
  
  .mentorship-card {
    flex-direction: column;
  }
  
  .mentorship-img {
    width: 100%;
    height: 200px;
  }

  .mentorship-body {
    padding: 24px 16px;
  }

  /* Player Area */
  .player-container {
    flex-direction: column;
  }
  
  .player-right {
    width: 100%;
  }

  .video-wrapper {
    border-radius: 8px; /* Menos arredondamento no mobile fica melhor */
  }

  .lesson-nav {
    flex-direction: column;
    align-items: stretch !important;
    gap: 16px;
  }
  
  .lesson-nav > div {
    justify-content: space-between;
  }

  .lesson-nav > div:last-child {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }

  .lesson-nav > div:last-child > button {
    justify-content: center;
  }

  .lesson-nav > div:last-child > .rating-container {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* Tabs do player */
  .tabs-header {
    flex-wrap: wrap;
  }
  .tab-link {
    flex-grow: 1;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .offer-banner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .offer-banner > div {
    flex-direction: column;
  }
}
