/* Dynamic color variables are set in a <style> tag in the layout.html template */
:root {
  --primary-color: #4A8BDF;  /* Royal blue */
  --secondary-color: #EFFAFD; /* Pale blue */
  --bg-color: #EFFAFD; /* Pale blue */
  --card-color: #ffffff;
  --text-color: #333333;
  --text-secondary: #6c757d;
  --accent-color: #A0006D; /* Eggplant */
  --success-color: #2dce89;
  --info-color: #11cdef;
  --warning-color: #fb6340;
  --danger-color: #f5365c;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.navbar {
  /* background-color is now set in layout.html to use secondary-color */
  /* box-shadow is also set in layout.html */
}

.navbar-brand {
  font-weight: 700;
  color: white !important;
  letter-spacing: 0.5px;
}

/* Note: nav-link styles are now in layout.html for better integration with the new design */

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

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 5px 15px rgba(74, 139, 223, 0.4);
  transform: translateY(-2px);
}

.card {
  border-radius: 12px;
  border: none;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  background-color: var(--card-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: rgba(74, 139, 223, 0.1);
  border-bottom: none;
  font-weight: 600;
  color: var(--primary-color);
}

.list-group-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.subject-card, .domain-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.subject-card .card-body, .domain-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.subject-card .card-footer, .domain-card .card-footer {
  margin-top: auto;
  background-color: transparent;
  border-top: none;
}

.flashcard {
  perspective: 1000px;
  min-height: 300px;
  position: relative;
  margin-bottom: 30px;
}

.flashcard-inner {
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  position: relative;
  display: flex;
  align-items: stretch;
}

.flashcard.flipped .flashcard-inner,
.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg) !important;
}

.flashcard-front, .flashcard-back {
  width: 100%;
  min-height: 300px;
  position: absolute;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 25px;
  text-align: center;
  border-radius: 12px;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.flashcard-front {
  background-color: white;
  color: var(--text-color);
  border: 2px solid var(--primary-color);
}

.flashcard-back {
  background-color: var(--primary-color);
  color: white;
  transform: rotateY(180deg);
}

.study-controls {
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
}

/* Flashcard content styling */
.answer-content, .explanation-content {
  width: 100%;
  max-width: 100%;
  margin-bottom: 15px;
}

.explanation-container {
  width: 100%;
  margin-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 15px;
}

.explanation-content {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  text-align: left;
  margin-top: 10px;
}

.toggle-explanation {
  transition: all 0.3s ease;
  border-color: rgba(255, 255, 255, 0.5);
}

.toggle-explanation:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Review marker checkbox styling */
.review-marker {
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-size: 0.85rem;
}

.flashcard-actions {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.domain-badge {
  position: absolute;
  bottom: 45px;
  right: 15px;
}

.alert {
  border-radius: 10px;
  border: none;
}

.jumbotron {
  background-color: rgba(74, 139, 223, 0.1);
  border-radius: 12px;
  padding: 3rem;
  margin-bottom: 2rem;
}

.form-control {
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px 15px;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(74, 139, 223, 0.25);
}

/* Rich content styling */
.rich-content {
  margin-bottom: 20px;
}

.rich-content h1, 
.rich-content h2, 
.rich-content h3, 
.rich-content h4, 
.rich-content h5, 
.rich-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.rich-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.rich-content ul, 
.rich-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.rich-content li {
  margin-bottom: 0.5rem;
}

.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.rich-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary-color);
  transition: all 0.3s ease;
}

.rich-content a:hover {
  color: var(--accent-color);
  border-bottom: 1px solid var(--accent-color);
}

.rich-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.rich-content table th, 
.rich-content table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

.rich-content table th {
  background-color: rgba(74, 139, 223, 0.1);
  font-weight: 600;
}

.rich-content blockquote {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 4px solid var(--primary-color);
  background-color: rgba(74, 139, 223, 0.05);
}

/* Quill editor specific styles */
.ql-container {
  border-radius: 0 0 8px 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-top: none !important;
}

.ql-toolbar {
  border-radius: 8px 8px 0 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background-color: #f8f9fa;
}

.ql-editor {
  min-height: 200px;
}

/* AI Assistant Styles */
#ai-assistant-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#ai-assistant-container:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#ai-assistant-container .card-header {
  background-color: var(--primary-color);
  border-bottom: none;
  color: white;
  font-weight: 600;
  padding: 12px 20px;
}

#ai-assistant-container .ai-query-form {
  margin-bottom: 15px;
}

#ai-assistant-container .form-text {
  font-size: 0.85rem;
  margin-top: 6px;
  color: var(--text-secondary);
}

#ai-assistant-container .ai-response {
  margin-bottom: 20px;
}

#ai-assistant-container .ai-response-content {
  padding: 15px;
  background-color: rgba(74, 139, 223, 0.05);
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

#ai-assistant-container .note-card {
  transition: all 0.3s ease;
  border-radius: 8px;
  background-color: #f4fafd;
}

#ai-assistant-container .note-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

#ai-assistant-container .note-content {
  font-size: 0.9rem;
  line-height: 1.5;
}

#ai-assistant-container code {
  background-color: #f1f1f1;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

#ai-assistant-container pre {
  background-color: #f1f1f1;
  padding: 12px;
  border-radius: 5px;
  font-size: 0.9em;
  max-height: 300px;
  overflow-y: auto;
  margin: 10px 0;
}