/* Contenu principal */
.main-content {
  flex: 1;
  padding: 1.5rem;
  margin-left: 0;
  transition: margin-left 0.3s ease;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
}

.sidebar-open .main-content {
  margin-left: var(--sidebar-width);
}

/* Barre d'outils */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  white-space: nowrap;
}

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

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

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

.btn-outline:hover {
  background-color: #f8f9fa;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: var(--text-color);
}

.btn-icon:hover {
  background-color: #e9ecef;
}

/* Conteneur de diapositive */
.slide-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.slide-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Indicateur de page */
.page-indicator {
  text-align: center;
  color: var(--text-light);
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* Outils d'apprentissage */
.learning-tools {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

.tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tool-btn.active {
  background-color: var(--primary-color);
  color: white;
}

/* Panneaux latéraux */
.panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 320px;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.panel.open {
  transform: translateX(0);
}

.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Styles pour les notes */
.note-form {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.note-form .form-group {
  margin-bottom: 1rem;
}

.note-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.note-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-item {
  background-color: #f8f9fa;
  border-left: 3px solid var(--primary-color);
  padding: 1rem;
  border-radius: 0 4px 4px 0;
  position: relative;
}

.note-content {
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

.note-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note-actions {
  display: flex;
  gap: 0.5rem;
}

.note-actions button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.note-actions button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
}

/* Styles pour les signets */
.bookmark-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.bookmark-item:hover {
  background-color: #f8f9fa;
}

.bookmark-icon {
  margin-right: 0.75rem;
  color: var(--warning-color);
}

.bookmark-details {
  flex: 1;
}

.bookmark-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.bookmark-page {
  font-size: 0.8rem;
  color: var(--text-light);
}

.bookmark-remove {
  color: var(--danger-color);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}

.bookmark-remove:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Styles pour les surlignages */
.highlight-colors {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.highlight-color {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-color:hover {
  transform: scale(1.1);
}

.highlight-color.active {
  border-color: var(--text-color);
}

.highlight-item {
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  position: relative;
  padding-left: 2rem;
}

.highlight-item::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 32px;
  border-radius: 4px;
}

.highlight-item.yellow { background-color: rgba(255, 243, 205, 0.3); }
.highlight-item.green { background-color: rgba(212, 237, 218, 0.3); }
.highlight-item.blue { background-color: rgba(204, 229, 255, 0.3); }
.highlight-item.pink { background-color: rgba(248, 215, 218, 0.3); }
.highlight-item.orange { background-color: rgba(255, 232, 204, 0.3); }

.highlight-item.yellow::before { background-color: #fff3cd; }
.highlight-item.green::before { background-color: #d4edda; }
.highlight-item.blue::before { background-color: #cce5ff; }
.highlight-item.pink::before { background-color: #f8d7da; }
.highlight-item.orange::before { background-color: #ffe8cc; }

/* Styles pour le quiz */
.quiz-intro {
  text-align: center;
  padding: 2rem 1rem;
}

.quiz-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.quiz-intro h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.quiz-intro p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.quiz-question {
  margin-bottom: 1.5rem;
}

.quiz-question-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.quiz-option:hover {
  background-color: #f8f9fa;
}

.quiz-option.correct {
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.quiz-option.incorrect {
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.quiz-option input[type="radio"] {
  margin-right: 0.75rem;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct {
  background-color: #d4edda;
  border-left: 4px solid #28a745;
  color: #155724;
}

.quiz-feedback.incorrect {
  background-color: #f8d7da;
  border-left: 4px solid #dc3545;
  color: #721c24;
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.quiz-progress {
  text-align: center;
  margin: 1rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.quiz-results {
  text-align: center;
  padding: 2rem 1rem;
}

.quiz-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
}

.quiz-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Styles responsifs */
@media (max-width: 992px) {
  .main-content {
    padding: 1rem;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .nav-buttons, .tool-actions {
    justify-content: center;
  }
  
  .page-indicator {
    text-align: center;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 90%;
  }
  
  .header-title {
    font-size: 1.1rem;
  }
  
  .note-form textarea {
    min-height: 80px;
  }
  
  .quiz-option {
    padding: 0.75rem;
  }
  
  .quiz-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .quiz-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }
  
  .user-actions {
    gap: 0.5rem;
  }
  
  .user-actions button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .learning-tools {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
  }
  
  .tool-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .panel {
    width: 100%;
    max-width: 100%;
  }
  
  .quiz-option {
    font-size: 0.9rem;
  }
}

/* Mode sombre */
[data-theme="dark"] {
  --primary-color: #00a884;
  --primary-light: #00c29a;
  --secondary-color: #2d3748;
  --text-color: #e2e8f0;
  --text-light: #a0aec0;
  --border-color: #4a5568;
  --bg-color: #1a202c;
  --bg-secondary: #2d3748;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .panel,
[data-theme="dark"] .slide-container,
[data-theme="dark"] .tool-btn,
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .highlight-colors {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .note-item,
[data-theme="dark"] .highlight-item {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-icon {
  background-color: var(--bg-secondary);
  color: var(--text-color);
}

[data-theme="dark"] .btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tool-btn {
  background-color: var(--bg-secondary);
  color: var(--text-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tool-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

[data-theme="dark"] .highlight-colors {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .highlight-color {
  border-color: var(--border-color);
}

[data-theme="dark"] .highlight-color.active {
  border-color: var(--text-color);
}

/* Formulaire de notes */
.note-form {
  margin-bottom: 1.5rem;
}

.note-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.note {
  background-color: #f8f9fa;
  border-left: 3px solid var(--primary-color);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0 4px 4px 0;
}

.note-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.note-actions {
  display: flex;
  gap: 0.5rem;
}

.note-actions button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.note-actions button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Mode sombre */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

.dark-mode .sidebar,
.dark-mode .slide-container,
.dark-mode .panel {
  background-color: #2d2d2d;
  color: #e0e0e0;
}

.dark-mode .chapter-title,
.dark-mode .chapter-item {
  color: #e0e0e0;
}

.dark-mode .chapter-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .btn-outline {
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .btn-outline:hover {
  background-color: #333;
}

/* Responsive */
@media (max-width: 992px) {
  .main-content {
    padding: 1rem;
  }
  
  .panel {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 90%;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-buttons {
    justify-content: space-between;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 1rem;
  }
  
  .user-actions {
    gap: 0.5rem;
  }
  
  .user-actions button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .learning-tools {
    gap: 0.75rem;
  }
  
  .tool-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}
