body {
  background: #f8fafc;
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
}

.sidebar .nav-link {
  color: #334155;
  font-weight: 500;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 0.35rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar .nav-link-label {
  display: block;
  padding: 0.5rem 1rem;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem;
}

.navbar {
  border-radius: 1rem;
}

.card {
  border-radius: 1rem;
}

.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

@media (max-width: 991px) {
  .sidebar {
    width: 100%;
    position: relative;
  }
}

/* ========================================
   CHATBOT STYLES
   ======================================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: linear-gradient(135deg, #f0f9ff 0%, #f3f4f6 100%);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-history::-webkit-scrollbar {
  width: 6px;
}

.chat-history::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.message-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-group.user {
  justify-content: flex-end;
}

.message-group.ai {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 14px;
}

.message-bubble.user {
  background: #2563eb;
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.message-bubble.ai {
  background: white;
  color: #333;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.chat-form {
  display: flex;
  gap: 12px;
}

.chat-form textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-form button {
  padding: 12px 24px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-form button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.chat-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   QUIZ STYLES
   ======================================== */

.quiz-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.quiz-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  width: 150px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.quiz-content {
  padding: 32px;
}

.quiz-question {
  margin-bottom: 32px;
}

.question-number {
  display: inline-block;
  background: #2563eb;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 20px;
  line-height: 1.6;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f9fafb;
}

.option-label:hover {
  border-color: #2563eb;
  background: #f0f9ff;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  margin-right: 12px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
}

.option-text {
  font-size: 15px;
  color: #374151;
  flex: 1;
}

/* Quiz Result Styles */
.quiz-result-container {
  background: linear-gradient(135deg, #f0f9ff 0%, #f3f4f6 100%);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
}

.result-score {
  font-size: 64px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.result-message {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.result-detail {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 32px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #2563eb;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.result-actions a,
.result-actions button {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.result-actions .btn-primary {
  background: #2563eb;
  color: white;
}

.result-actions .btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.result-actions .btn-secondary {
  background: white;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.result-actions .btn-secondary:hover {
  background: #f0f9ff;
}

/* ========================================
   SUMMARY STYLES
   ======================================== */

.summary-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 32px;
}

.summary-header {
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.summary-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.summary-filename {
  font-size: 14px;
  color: #6b7280;
}

.summary-content {
  line-height: 1.8;
  color: #374151;
  font-size: 15px;
}

.summary-content p {
  margin-bottom: 16px;
}

.summary-content ul,
.summary-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.summary-content li {
  margin-bottom: 8px;
}

.summary-content strong {
  color: #1f2937;
  font-weight: 700;
}

/* PDF Viewer Styles */
.pdf-link {
  display: inline-block;
  padding: 8px 16px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
  cursor: pointer;
}

.pdf-link:hover {
  background: #2563eb;
  color: white;
  transform: translateX(2px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .message-bubble {
    max-width: 85%;
  }

  .quiz-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .chat-form {
    flex-direction: column;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions a,
  .result-actions button {
    width: 100%;
  }

  .sidebar {
    width: 100%;
  }
}

/* ========================================
   UPLOAD AREA STYLES
   ======================================== */

.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}

.upload-area:hover {
  border-color: #2563eb;
  background: #f0f9ff;
}

.upload-text {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: #6b7280;
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 4px solid transparent;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card.primary {
  border-left-color: #2563eb;
}

.stat-card.success {
  border-left-color: #10b981;
}

.stat-card.warning {
  border-left-color: #f59e0b;
}

.stat-card.danger {
  border-left-color: #ef4444;
}

.stat-card-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.stat-card-desc {
  font-size: 13px;
  color: #9ca3af;
}

/* Activity Timeline */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f9fafb;
  border-left: 3px solid #2563eb;
  transition: all 0.2s;
}

.activity-item:hover {
  background: #f0f9ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.activity-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
}

.activity-content {
  flex: 1;
}

.activity-desc {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 2px;
}

.activity-time {
  font-size: 12px;
  color: #9ca3af;
}

/* ========================================
   CARD STYLES
   ======================================== */

.card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}

/* ========================================
   BADGE STYLES
   ======================================== */

.badge-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
  color: white;
}

.badge-grade.success {
  background: #10b981;
}

.badge-grade.info {
  background: #3b82f6;
}

.badge-grade.warning {
  background: #f59e0b;
}

.badge-grade.danger {
  background: #ef4444;
}

/* ========================================
   MODAL CONFIRMATION
   ======================================== */

.confirmation-modal {
  z-index: 9999;
}

.confirmation-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* ========================================
   BUTTON STYLES
   ======================================== */

.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-secondary {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-outline-primary {
  border: 2px solid #2563eb;
  color: #2563eb;
  background: transparent;
}

.btn-outline-primary:hover {
  background: #2563eb;
  color: white;
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
