/* SQL Training Platform - Internal Application Styles */

/* CSS Variables */
:root {
  /* Primary Colors (4 Grundfarben) */
  --color-primary: #428bc0;
  /* Steel Blue */
  --color-secondary: #909090;
  /* Ebony */
  --color-thirdary: #87255B;
  /* Dark Raspberry */
  --color-fourthary: #1D3461;
  /* Twilight Indigo */

  /* Accent Colors (basierend auf Grundfarben) */
  --color-accent: var(--color-fourthary);
  --color-accent-light: #e8eef5;

  /* Derived Colors (heller/dunkler Varianten der 4 Grundfarben) */
  --color-primary-light: #6ba8d4;
  --color-primary-dark: #2d6a9f;
  --color-thirdary-light: #a64d7a;
  --color-fourthary-light: #2d4a7c;

  /* Grays */
  --color-gray-lightest: #f9f9f9;
  --color-gray-lighter: #f5f5f5;
  --color-gray-light: #f1f1f1;
  --color-gray: #f0f0f0;
  --color-gray-medium: #e0e0e0;
  --color-gray-dark: #888;

  /* Dark Theme Colors */
  --color-dark-bg: #1e1e1e;
  --color-dark-border: #2a2a2a;
  --color-dark-gray: #555;

  /* Backgrounds */
  --bg-white: #ffffff;
  --bg-light: #f5f7fa;
  --bg-light-secondary: #c3cfe2;

  /* Gradients */
  --gradient-page: linear-gradient(135deg, var(--color-primary) 0%, var(--color-fourthary) 100%);
  --gradient-nav: linear-gradient(135deg, var(--color-fourthary) 0%, var(--color-thirdary) 100%);
  --gradient-light: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-light-secondary) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Sticky Footer Layout */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body>.container,
body>main,
body>section {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

/* Material Icons Size Classes */
.material-icons.tiny {
  font-size: 16px;
}

.material-icons.small {
  font-size: 20px;
}

.material-icons.medium {
  font-size: 24px;
}

.material-icons.large {
  font-size: 36px;
}

/* Fix vertical alignment for headings/titles with icons */
/* Only apply flex when element has an icon child */
.title:has(> .icon),
.title:has(> i),
h1:has(> .icon), h2:has(> .icon), h3:has(> .icon), h4:has(> .icon), h5:has(> .icon), h6:has(> .icon),
.label:has(> .icon),
.modal-card-title:has(> .icon),
.modal-card-title:has(> i) {
  display: flex;
  align-items: center;
  gap: 6px;
}

.title > .icon,
h1 > .icon, h2 > .icon, h3 > .icon, h4 > .icon, h5 > .icon, h6 > .icon,
.label > .icon,
.modal-card-title > .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* General icon alignment fix */
.icon .material-icons,
.icon > .material-icons {
  vertical-align: middle;
  line-height: 1;
}

/* Dashboard Navbar (White & Clean) */
nav.navbar,
nav.admin-nav,
nav.school-admin-nav {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  flex-shrink: 0; /* Prevent navbar from shrinking */
}

nav .container {
  display: flex;
  align-items: center;
}

/* Navbar Logo */
.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  max-height: none !important;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.logo-text-secondary {
  color: var(--color-secondary);
  font-weight: 700;
}

/* Navbar Items */
nav .navbar-menu {
  box-shadow: none;
  /* Remove bulma mobile shadow */
}

nav .navbar-item,
nav .navbar-link {
  color: var(--color-fourthary);
  font-weight: 600;
}

nav .navbar-item:hover,
nav .navbar-link:hover {
  background-color: var(--color-gray-light);
  color: var(--color-primary);
}

nav .navbar-item .icon {
  color: var(--color-primary);
}

nav .navbar-item:hover .icon {
  color: var(--color-fourthary);
}

/* Page Header */
.page-header {
  padding: 20px 0;
  background: var(--gradient-light);
  margin-bottom: 30px
}

/* Teacher Dashboard Specific Styles */
.group-card {
  border-radius: 8px;
  transition: transform 0.2s;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.group-code {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-primary);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

/* Group type badge (corner ribbon) */
.group-type-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.group-type-badge i {
  font-size: 18px;
}

.group-type-badge.exam {
  background: linear-gradient(135deg, #f14668 0%, #cc0f35 100%);
}

.group-type-badge.exercise {
  background: linear-gradient(135deg, #48c78e 0%, #257953 100%);
}

.group-type-badge.observer {
  background: linear-gradient(135deg, #7c5cbf, #5a3d8a);
}

/* Observer card styling */
.group-card.is-observer {
  border-left: 4px solid #7c5cbf;
}

.group-card.is-observer .card-header {
  background: linear-gradient(135deg, #f5f0ff, #ede5ff);
}

/* Share badge on own cards */
.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e8f4fc;
  color: #3273dc;
  border: 1px solid #b5d5f5;
}

.share-badge.is-active {
  background: #3273dc;
  color: white;
  border-color: #3273dc;
}

.share-badge i {
  font-size: 12px;
}

/* Card footer delete link */
.group-card .card-footer-item.has-text-danger {
  font-size: 0.85rem;
  transition: background-color 0.2s;
}

.group-card .card-footer-item.has-text-danger:hover {
  background-color: #fff5f5;
}

.cursor {
  cursor: pointer;
}

h6 {
  margin: 0rem 0 .46rem 0;
}

/* Task Manager Modal - Large */
#taskManagerModal .modal-content {
  max-width: 95vw;
  width: 95vw;
  max-height: 90vh;
  height: 90vh;
  overflow: hidden;
  padding: 20px;
  background: white;
  border-radius: 8px;
}

.task-section {
  height: 45%;
  border: 1px solid var(--color-gray-medium);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.split-view {
  display: flex;
  gap: 15px;
  height: 100%;
}

.split-left {
  flex: 1;
  overflow-y: auto;
}

.split-right {
  flex: 2;
  overflow: hidden;
}

.table-list {
  max-height: 300px;
  overflow-y: auto;
}

.table-item {
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 5px;
  background: var(--color-gray-lighter);
  transition: background 0.2s;
}

.table-item:hover {
  background: var(--color-gray-medium);
}

.table-item.active {
  background: var(--color-primary);
  color: white;
}

.query-editor-container {
  width: 100%;
  height: 170px;
  border: 1px solid var(--color-dark-border);
  border-radius: 4px;
  background: var(--color-dark-bg);
  overflow: hidden;
}

.task-list-item {
  border-left: 4px solid var(--color-primary);
  padding: 10px;
  padding-left: 8px;
  margin-bottom: 10px;
  background: var(--color-gray-lightest);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-list-item:hover {
  background: var(--color-gray);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.task-list-item.dragging {
  opacity: 0.5;
  background: var(--color-primary-light);
}

.task-list-item .drag-handle {
  cursor: grab;
  color: var(--color-gray-dark);
  display: flex;
  align-items: center;
}

.task-list-item .drag-handle:hover {
  color: var(--color-primary);
}

.task-list-item .drag-handle:active {
  cursor: grabbing;
}

.task-list-container {
  max-height: calc(100% - 60px);
  overflow-y: auto;
}

#tabulatorTable,
#queryResultTable {
  height: calc(100% - 40px);
}
.modal-card-head {
  padding: 20px;
}
/* Template & Groups Layout */
.dashboard-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.groups-container {
  flex: 1;
  padding-right: 20px;
  border-right: 2px solid var(--color-gray-medium);
}

.groups-wrapper {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.template-sidebar {
  flex: 0 0 calc(33.333% - 30px);
  max-width: calc(33.333% - 30px);
}

.template-list {
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 10px;
}

.template-card {
  border-radius: 8px;
  margin-bottom: 15px;
  transition: transform 0.2s;
  border-left: 4px solid var(--color-primary);
  cursor: pointer;
}

.template-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.template-stats {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
}

.template-list::-webkit-scrollbar {
  width: 8px;
}

.template-list::-webkit-scrollbar-track {
  background: var(--color-gray-light);
  border-radius: 10px;
}

.template-list::-webkit-scrollbar-thumb {
  background: var(--color-gray-dark);
  border-radius: 10px;
}

.template-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark-gray);
}

/* Student Practice Page Styles */
body.practice-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--color-gray-lighter);
}

.main-container {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Sidebar - Schema */
.schema-sidebar {
  width: 250px;
  background: white;
  border-right: 1px solid var(--color-gray-medium);
  overflow-y: auto;
  padding: 15px;
}

.schema-sidebar h6 {
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 0;
}

.schema-sidebar .table-item {
  margin-bottom: 15px;
  padding: 10px;
  background: var(--color-gray-lighter);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.schema-sidebar .table-item:hover {
  background: #e8eaf6;
  transform: translateX(5px);
}

.table-name {
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  gap: 5px;
}

.column-list {
  margin-top: 8px;
  padding-left: 10px;
  font-size: 0.85rem;
}

.column-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  color: #666;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s;
}

.column-item:hover {
  background-color: #e3f2fd;
  color: #1565c0;
}

.column-item:hover .column-name {
  text-decoration: underline;
}

.column-type {
  color: #999;
  font-size: 0.75rem;
}

/* Center Content Area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Question Area (Top) */
.question-area {
  background: white;
  padding: 20px;
  border-bottom: 2px solid var(--color-primary);
  max-height: 200px;
  overflow-y: auto;
}

.question-title {
  color: var(--color-primary);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.question-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: #e8eaf6;
  color: var(--color-primary);
}

/* SQL Editor Area */
.editor-area {
  flex: 0 0 auto;
  height: 22vh;
  display: flex;
  flex-direction: column;
  background: var(--color-dark-bg);
  min-height: 0;
}

.editor-header {
  background: #37474f;
  color: white;
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#sqlEditorContainer {
  flex: 1;
  overflow: hidden;
  background: var(--color-dark-bg);
}

#sqlEditorContainer .cm-editor {
  height: 100%;
  background: var(--color-dark-bg);
}

/* Output Area (Bottom) */
.output-area {
  flex: 1;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.output-header {
  background: var(--color-gray-lighter);
  padding: 8px 15px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #333;
}

.output-content {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

.result-table {
  font-size: 0.85rem;
}

.result-table th {
  background: var(--color-primary);
  color: white;
}

/* Right Sidebar - Hints & Progress */
.hints-sidebar {
  width: 280px;
  background: white;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.progress-section {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.progress-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px 0;
}

.progress-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--color-primary);
}

.hints-section {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.hint-item {
  background: #fff3cd;
  padding: 10px;
  margin-bottom: 10px;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
  font-size: 0.9rem;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
}

.success-message {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
}

/* Navigation Buttons */
.nav-buttons {
  display: flex;
  gap: 10px;
}

/* Typewriter Effect */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: var(--color-primary);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

@keyframes blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.typewriter-text {
  display: inline;
}

/* AI Loading Animation */
.rotating {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.ai-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f5f5f5;
  border-top: 3px solid #ffdd57;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* Admin Dashboard Styles */
.stats-card {
  border-radius: 8px;
  padding: 12px 15px;
  text-align: center;
  color: white;
  margin-bottom: 15px;
}

.stats-card i {
  font-size: 24px !important;
}

.stats-card h2 {
  margin: 5px 0 2px 0;
  font-size: 1.5rem;
  font-weight: bold;
}

.stats-card p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.85rem;
}

/* Stats Cards - basierend auf den 4 Grundfarben */
.stats-card.blue,
.stats-card.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.stats-card.green,
.stats-card.fourthary {
  background: linear-gradient(135deg, var(--color-fourthary-light) 0%, var(--color-fourthary) 100%);
}

.stats-card.orange,
.stats-card.secondary {
  background: linear-gradient(135deg, #7a7a7a 0%, var(--color-secondary) 100%);
}

.stats-card.purple,
.stats-card.thirdary {
  background: linear-gradient(135deg, var(--color-thirdary-light) 0%, var(--color-thirdary) 100%);
}

.stats-card.red {
  background: linear-gradient(135deg, var(--color-thirdary) 0%, #5a1a3d 100%);
}

.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-status.pending {
  background: #FFF3E0;
  color: #E65100;
}

.badge-status.verified {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-status.active {
  background: #E3F2FD;
  color: #1565C0;
}

.badge-status.suspended {
  background: #FFEBEE;
  color: #C62828;
}

.badge-verified {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-verified.true {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-verified.false {
  background: #FFF3E0;
  color: #E65100;
}

.action-btn {
  margin: 0 2px;
  padding: 4px 8px;
  font-size: 12px;
}

#schoolsTable,
#teachersTable,
#templatesTable,
#groupsTable {
  font-size: 13px;
}

/* Tabulator Tables - Global fix for all dashboards */
.box:has(.tabulator) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  contain: inline-size;
}

.box:has(.tabulator) .tabulator {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.tabulator .tabulator-tableholder {
  overflow-x: auto !important;
}

/* Own templates highlighting moved to teacherTables.css */

/* Inline FAB Button (in header) */
.fab-button-inline {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-fourthary) 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.fab-button-inline:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.fab-button-inline i {
  font-size: 28px;
}

/* Help Modal */
.help-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-gray-medium);
}

.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section h6 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-fourthary);
  margin-bottom: 10px;
}

.help-section h6 i {
  font-size: 20px;
}

.help-list {
  margin-left: 28px;
}

.help-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ========================================
   Teacher Dashboard - Ticker Styles
   ======================================== */

.compact-header {
  padding: 0.5rem 0;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
}

.header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ticker-wrapper {
  flex: 1;
  max-width: 600px;
  background: #202c3a;
  color: #fff;
  height: 32px;
  line-height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.ticker-label {
  background: var(--color-primary-dark);
  color: white;
  padding: 0 10px;
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  margin-left: 10px;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 20s linear infinite;
  padding-left: 100%;
  font-size: 0.9rem;
  font-weight: 500;
}

.ticker-wrapper:hover .ticker-text {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ========================================
   Switch Toggle Component
   ======================================== */

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  margin-right: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Answer Mode Help Wrapper - Collapsible Animation */
.answer-mode-help-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.25s ease-out, margin 0.3s ease-out;
  margin-top: 0;
}

.answer-mode-help-wrapper.is-visible {
  max-height: 300px;
  opacity: 1;
  margin-top: 0.5rem;
}

/* ========================================
   Common Layout Utilities (Semantic)
   ======================================== */

/* Flex layouts */
.flex-center {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-baseline {
  display: flex;
  align-items: baseline;
}

.flex-gap-sm {
  gap: 6px;
}

.flex-gap-md {
  gap: 10px;
}

.flex-gap-lg {
  gap: 15px;
}

.flex-gap-xl {
  gap: 20px;
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mr-10 { margin-right: 10px; }
.ml-4 { margin-left: 1.5rem; }
.ml-5 { margin-left: 5px; }
.ml-10 { margin-left: 10px; }
.m-0 { margin: 0; }
.flex-1 { flex: 1; }

/* ========================================
   Stat Cards
   ======================================== */

.stat-box {
  padding: 1rem;
}

.stat-column {
  padding: 0.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================================
   Tab Content
   ======================================== */

.tab-table {
  margin-top: 20px;
}

.tab-form-addons {
  margin-top: 20px;
  margin-bottom: 20px;
}

.checkbox-addon {
  padding: 8px 12px;
  border: 1px solid #dbdbdb;
  border-radius: 0;
  background: #f5f5f5;
}

/* ========================================
   Info Notification
   ======================================== */

.info-notification {
  margin-bottom: 20px;
}

.info-notification-field {
  margin-top: 10px;
}

.registration-link-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.registration-link-content {
  flex: 1;
}

/* Hidden by JS */
.js-hidden {
  display: none;
}

/* ========================================
   Modal Layouts
   ======================================== */

.modal-wide {
  max-width: 900px;
  width: 90vw;
}

.modal-fullscreen {
  max-width: 95vw;
  width: 95vw;
  height: 90vh;
  max-height: 90vh;
  background: white;
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.modal-section-box {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
}

.modal-section-box.flex-column {
  display: flex;
  flex-direction: column;
}

.modal-section-box.mb-15 {
  margin-bottom: 15px;
}

/* ========================================
   Accordion Component
   ======================================== */

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f9f9f9;
  cursor: pointer;
  user-select: none;
}

.accordion-content {
  padding: 10px;
  max-height: 350px;
  overflow: auto;
}

/* ========================================
   Results Modal Specific
   ======================================== */

.results-scores-section {
  flex: 2;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #48c774;
  border-radius: 50%;
  margin-right: 5px;
  animation: pulse 1.5s infinite;
}

/* ========================================
   Group Card Header
   ======================================== */

.groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.groups-title-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.groups-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   Welcome Section
   ======================================== */

.welcome-section {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.welcome-subtitle {
  font-size: 0.8rem;
  margin: 0;
}

/* ========================================
   Template Sidebar Header
   ======================================== */

.template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.template-tabs {
  margin-bottom: 10px;
}

/* Radio buttons as block elements */
.radio.is-block {
  display: block;
}

/* ========================================
   Offcanvas Panel (for template selection)
   ======================================== */

.offcanvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.offcanvas-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.offcanvas-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: white;
  z-index: 101;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.offcanvas-panel.is-active {
  right: 0;
}

.offcanvas-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5f5f5;
}

.offcanvas-header .title {
  margin: 0;
}

.offcanvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.offcanvas-hint {
  background: #e8f4fc;
  border-left: 4px solid #3273dc;
  padding: 10px 15px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

/* When in selection mode, highlight rows on hover */
.offcanvas-panel .tabulator-row:hover {
  background-color: #e8f4fc !important;
  cursor: pointer;
}

.template-search {
  margin-bottom: 8px;
}

.template-search .input {
  border-radius: 4px;
}

.template-content-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.template-content-filters .content-filter-btn {
  flex: 1;
  font-size: 0.7rem;
  padding: 4px 6px;
  height: auto;
  min-width: 0;
}

.template-content-filters .content-filter-btn.is-active {
  background-color: #3273dc;
  color: white;
  border-color: #3273dc;
}

.template-content-filters .content-filter-btn.is-exclude {
  background-color: #f14668;
  color: white;
  border-color: #f14668;
  text-decoration: line-through;
}

.template-content-filters .content-filter-btn .icon {
  margin-right: 2px;
}

.template-content-filters .content-filter-btn .icon i {
  font-size: 14px;
}

/* Favorite star in table */
.favorite-star {
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s;
}

.favorite-star:hover {
  color: #ffcc00;
}

.favorite-star.is-favorite {
  color: #ffcc00;
}

/* ========================================
   Delete Group Modal
   ======================================== */

.delete-modal-head {
  background-color: #f14668;
}

.delete-modal-foot {
  justify-content: flex-end;
  gap: 10px;
}

/* ========================================
   Duplicate Template Modal
   ======================================== */

.duplicate-modal-head {
  background: linear-gradient(135deg, #3273dc 0%, #48c774 100%);
}

/* ========================================
   Help Modal Sections
   ======================================== */

.help-box {
  margin-bottom: 1.25rem;
}

.help-box:last-child {
  margin-bottom: 0;
}

.help-box-blue {
  border-left: 4px solid #3273dc;
}

.help-box-yellow {
  border-left: 4px solid #ffdd57;
}

.help-box-green {
  border-left: 4px solid #48c774;
}

.help-box-red {
  border-left: 4px solid #f14668;
}

.help-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.help-icon-large {
  font-size: 28px;
}

.help-content {
  margin-left: 5px;
}

.help-content ul {
  margin-top: 0;
}

/* ========================================
   Info Boxes
   ======================================== */

.info-box {
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
}

.info-box-yellow {
  background: #fffbeb;
  border: 1px solid #ffdd57;
}

.info-box-blue {
  background: #f0f7ff;
  border: 1px solid #3298dc;
}

.info-box-light {
  background: #f5f5f5;
  border: 1px solid #dbdbdb;
}

.info-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  font-size: 0.92em;
}

.info-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 0.9em;
}

.info-card {
  background: white;
  border-radius: 4px;
  padding: 12px;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 0.88em;
  color: #555;
  margin-bottom: 8px;
}

.info-card ul {
  font-size: 0.85em;
  margin: 0;
  padding-left: 18px;
  color: #444;
}

.info-card-footer {
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
  font-size: 0.82em;
}

.info-card-footer.green {
  background: #e8f5e9;
}

.info-card-footer.yellow {
  background: #fff3cd;
}

/* ========================================
   Code Preview
   ======================================== */

.code-preview {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
}

.code-preview.scrollable {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85em;
}

/* Admin template preview - allow more height for questions */
#templatePreviewModal .code-preview.scrollable {
  max-height: 50vh;
}

/* ========================================
   Exam Settings
   ======================================== */

.exam-hint-box {
  display: none;
  padding: 10px;
  background-color: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 4px;
  border-left: 4px solid #ff9800;
  font-size: 0.9em;
}

.exam-modal-head {
  background-color: #fff3e0;
}

.exam-random-fields {
  display: none;
  background-color: #e3f2fd;
  padding: 10px;
  border-radius: 8px;
  margin-top: 5px;
}

.exam-random-header {
  margin-bottom: 10px;
}

.exam-target-points {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #90caf9;
}

/* ========================================
   Form Sections
   ======================================== */

.form-section {
  margin-top: 15px;
}

.form-section-group {
  padding: 12px;
  background: #f5f5f5;
  border-radius: 6px;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-checkbox-text small {
  color: #7a7a7a;
}

/* ========================================
   Button Styles
   ======================================== */

.btn-excel {
  background-color: #1D3461;
  color: white;
  border: none;
}

.btn-pdf {
  background-color: #87255B;
  color: white;
  border: none;
}

.btn-stats {
  background-color: #428bc0;
  color: white;
  border: none;
}

/* ========================================
   Questions View
   ======================================== */

.questions-modal-content {
  max-width: 900px;
  width: 90%;
  background: white;
  border-radius: 8px;
  padding: 20px;
}

.questions-loading {
  padding: 40px;
}

/* ========================================
   Task Detail Keyword Info
   ======================================== */

.keyword-info-box {
  border-left: 3px solid #3298dc;
}

/* ========================================
   Student Practice Page
   ======================================== */

.navbar-item-bold {
  font-weight: bold;
}

.exam-timer {
  font-weight: bold;
  color: #d32f2f;
}

.submit-exam-btn {
  margin-left: 5px;
}

.modal-sm .modal-card {
  max-width: 450px;
}

.danger-modal-head {
  background-color: #f14668;
}

.confirm-text {
  font-size: 1.1rem;
}

.modal-foot-right {
  justify-content: flex-end;
  gap: 10px;
}

/* ========================================
   Help Modal / Onboarding Styles
   ======================================== */

.help-modal-head {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Icon size utilities */
.icon-12 { font-size: 12px; }
.icon-14 { font-size: 14px; }
.icon-16 { font-size: 16px; }
.icon-28 { font-size: 28px; }

.icon-vmiddle {
  vertical-align: middle;
}

/* Tag with auto height */
.tag-auto-height {
  height: auto;
}

/* Onboarding tip notification */
.onboarding-tip {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 0.88em;
  margin-bottom: 0;
}

.onboarding-text-center {
  margin: 15px 0 5px 0;
  text-align: center;
}

/* Help section boxes */
.help-box-success {
  border-left: 4px solid #48c774;
  margin-bottom: 1.25rem;
}

.help-box-danger {
  border-left: 4px solid #f14668;
  margin-bottom: 0;
}

.help-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.help-box-header .title {
  margin: 0;
}

.help-box-intro {
  margin-bottom: 10px;
}

.help-box-content {
  margin-left: 5px;
}

.help-box-content ul {
  margin-top: 0;
}

/* Mode comparison sections */
.mode-section {
  background: #f0f7ff;
  border: 1px solid #3298dc;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.mode-section-neutral {
  background: #f5f5f5;
  border: 1px solid #dbdbdb;
}

.mode-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 0.9em;
}

.mode-card {
  background: white;
  border-radius: 4px;
  padding: 12px;
}

.mode-card-green {
  background: #f0fff4;
  border: 1px solid #48c774;
}

.mode-card-yellow {
  background: #fff8e1;
  border: 1px solid #ffb300;
}

.mode-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 0.88em;
  color: #555;
  margin-bottom: 8px;
}

.mode-card-list {
  font-size: 0.85em;
  margin: 0;
  padding-left: 18px;
  color: #444;
}

.mode-card-note {
  color: #888;
  margin-top: 4px;
}

.mode-card-hint {
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
  font-size: 0.82em;
}

.mode-card-hint-green {
  background: #e8f5e9;
}

.mode-card-hint-yellow {
  background: #fff3cd;
}

.mode-section-footer {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 0.85em;
  margin-bottom: 0;
  background: #e8f4fc;
}

.mode-section-footer-neutral {
  background: #fafafa;
}

.tag-new {
  font-size: 0.7em;
}

/* Modal utilities */
.modal-xs .modal-card {
  max-width: 400px;
}

.modal-foot-end {
  justify-content: flex-end;
}

/* Table utilities */
.table-scrollable {
  max-height: 390px;
  overflow-y: auto;
}

.th-checkbox {
  width: 40px;
}

/* ========================================
   Download Dropdown Styles
   ======================================== */

#downloadDropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
}

#downloadDropdown .dropdown-item .icon {
  color: var(--color-primary);
}

#downloadDropdown .dropdown-item:hover {
  background-color: var(--color-gray-light);
}

#downloadDropdown .dropdown-item .tag {
  font-size: 0.65rem;
}

/* ========================================
   AI Task Generation Styles
   ======================================== */

.ai-task-item {
  transition: background-color 0.3s ease;
}

.ai-task-item .textarea {
  font-size: 0.85rem;
}

.ai-task-item.has-background-success-light {
  opacity: 0.7;
}

#aiGeneratedTasksList {
  max-height: 50vh;
  overflow-y: auto;
}

#aiGenerateBtn {
  transition: all 0.2s ease;
}

#aiGenerateBtn:hover {
  transform: scale(1.05);
}

.py-20 {
  padding-top: 20px;
  padding-bottom: 20px;
}