/* Base Styles */nhtml, body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Container */
.site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content {
  flex: 1;
  margin-left: 20px;
}
#messages-link {
  position: relative;
}

#unread-count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  background: #dc3545;
  color: #fff;
  border-radius: 50%;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  min-width: 1rem;
  text-align: center;
  display: none;
}
/* Header & Nav */
.header {
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-logo {
  max-height: 100px;
}
.navbar-logo2 {
  max-height: 150px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.nav-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.skill-level {
  margin-left: 0.5rem;
  font-weight: 600;
}

.nav-actions {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}
/* Buttons */
/* Base button styles */
button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  box-shadow: 0 4px 10px rgba(99,102,241,0.4);
}

/* Hover state */
button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99,102,241,0.6);
}

/* Active/pressed state */
button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

/* Disabled state */
button:disabled {
  background: #c7d2fe;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}


.btn{
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.2s;
}
.btn-primary { background-color: #3b82f6; color: #fff; }
.btn-primary:hover { background-color: #2563eb; }
.btn-secondary {
  background-color: #f0f9ff;         /* vaaleansininen tausta */
  color: #2563eb;                    /* tummansininen teksti */
  border: 2px solid #2563eb;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;

}

.btn-secondary:hover {
  background-color: #2563eb;        /* sininen hover-tausta */
  color: #ffffff;                   /* valkoinen teksti hoverissa */
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.btn-tertiary { background-color: #f59e0b; color: #fff; }
.btn-tertiary:hover { opacity: 0.9; }
.btn-outline { background: none; border-color: #6b7280; color: #6b7280; }
.btn-outline:hover { color: #1f2937; border-color: #1f2937; }

/* Hero Section */
.hero-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #b9e7c3, #061a09);
  color: #fff;
  padding: 4rem 2rem;
}
.hero-text { flex: 1 1 300px; max-width: 600px; }
.hero-text h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero-text p { font-size: 1.1rem; margin-bottom: 1.5rem; }
.hero-image { flex: 1 1 300px; text-align: center; }

/* Features Section */
.features-section { padding: 3rem 2rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-5px); }
.feature-card h3 { margin-bottom: 0.75rem; }
.toggle-content { margin-top: 1rem; display: none; }
.feature-card.active .toggle-content { display: block; }

/* Courses Section */
.courses-section { padding: 3rem 2rem; }
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.course-card {
  background-color: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.course-card img { height: 160px; object-fit: cover; }
.course-card h3 { margin: 1rem 0; }
.course-card p { padding: 0 1rem; color: #6b7280; }
.course-card a.btn { margin: 1rem auto 1.5rem; }

/* Footer */
.site-footer { background-color: #fff; text-align: center; padding: 1.5rem 0; border-top: 1px solid #e5e7eb; }
#language-selector a { margin: 0 0.5rem; color: #6b7280; font-size: 0.9rem; }
#language-selector a:hover { color: #1f2937; }

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-toggle {
    display: block;
    margin-left: auto;
    margin-top:10px;
  }
  .nav-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 0.5rem;
  }
  .nav-actions.active {
    display: flex;
  }
  .nav-actions a,
  .nav-actions button {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
 .hero-section { flex-direction: column; text-align: center; }
  .hero-image { margin-top: 2rem; }
  .navbar-logo {
    max-height: 50px;
  }
  .navbar-logo2 {
    max-height: 80px;
  }
  .main-content {
  flex: 1;
  margin-left: 20px;
  width:90%;
}
.hero-text {
max-width:90%;
}
.hero-text h1{
font-size:2rem;
}
}
#logo{
max-width:200px;
}
/* Login Page - Epic Styles */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  background: linear-gradient(135deg, #1e3a8a, #9333ea);
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('{{ url_for('static', filename='images/math-pattern.svg') }}') no-repeat center/cover;
  opacity: 0.1;
  z-index: 0;
}
.login-form {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  padding: 3rem;
  border-radius: 2rem;
  box-shadow: 0 8px 32px rgba(31,38,135,0.37);
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-form h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: #111827;
  letter-spacing: 0.5px;
}
.login-form .flash {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #b91c1c;
  margin-bottom: 1rem;
  font-weight: 500;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  border: 1px solid rgba(31, 41, 55, 0.4);
  background: rgba(255,255,255,0.6);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.login-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
  background: rgba(255,255,255,0.8);
}
.login-form .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.login-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}
/* Aseta lomake kolonniin ja lisää väliä kenttien väliin */
.login-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Labelit block-tason elementeiksi, niin ne tulevat omalle rivilleen */
.login-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

/* Inputit 100% leveydelle, block-tason elementeiksi */
.login-form input[type="text"],
.login-form input[type="password"] {
  display: block;
  width: 90%;
}

/* Jos haluat, että nappi myös cadenssi: */
.login-form button[type="submit"] {
  align-self: flex-end; /* asettaa napin oikeaan reunaan */
}

@media (max-width: 768px) {
  .hero-section { flex-direction: column; text-align: center; }
  .hero-image { margin-top: 2rem; }
  .login-page { padding: 1rem; }
  .login-form { padding: 1.5rem; }
}
/* Courses Page Specific Styles */
.courses-page {
  background-color: #f8fafc;
  padding: 4rem 2rem;
}

.courses-page h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #111827;
  letter-spacing: 0.5px;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.course-card {
  background: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.course-card h3 {
  margin: 1.5rem 1rem 0.5rem;
  font-size: 1.5rem;
  color: white;
}

.course-card p {
  flex: 1;
  margin: 0 1rem 1.5rem;
  color: white;
  line-height: 1.5;
}

.course-card a.btn {
  margin: 0 1rem 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  text-align: center;
  font-weight: 500;
  transition: background 0.3s, transform 0.2s;
}

.course-card a.btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  transform: translateY(-2px);
}
.course-card.selected {
  border: 2px solid var(--color-primary);
  box-shadow: 0 4px 20px rgba(27,229,52,2), 0 0 0 6px rgba(59,130,246,0.3);
}
/* Course Page Layout */
.course-container {
  display: flex;
  flex-wrap: wrap;
  margin: 2rem auto;
  max-width: 1200px;
  gap: 2rem;
}

/* Sidebar */
.topics-sidebar {
  flex: 1 1 250px;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 1.5rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.topics-sidebar h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #1f2937;
  text-transform: uppercase;
}
.topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.topics-list li {
  margin-bottom: 0.75rem;
}
.topic-link {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: #f9fafb;
  border: none;
  border-radius: 0.5rem;
  text-align: left;
  font-size: 1rem;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.topic-link:hover {
  background-color: #e5e7eb;
}
.topic-link.active {
  background-color: var(--color-primary);
  color: #2ea167;
}
#sidebar-toggle {
  display: none;
  margin-bottom: 1rem;
}
.mobile-only {
  display: none;
}
/* Content Pane */
.content-pane {
  flex: 3 1 600px;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
.topic-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

/* Tasks Button */
.tasks-button-container {
  text-align: right;
}
.tasks-button-container .btn-primary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .course-container {
    flex-direction: column;
    margin: 1rem;
    position: relative;
  }
  .topics-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    max-height: none;
    padding: 1rem;
    overflow-y: auto;
  }
  .topics-sidebar.open {
    transform: translateX(0);
  }
  #sidebar-toggle {
    display: block;
  }
  .mobile-only {
    display: inline-block;
  }
  .content-pane {
    padding: 1rem;
    width: 90%;
  }
  .tasks-button-container {
    flex-direction: column;
    align-items: stretch;
  }
  #buttonwrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  #buttonwrap .btn {
    width: 100%;
  }
}
/* Tasks Page Styles */
.tasks-page {
  padding: 2rem;
  background-color: #f3f4f6;
}
.tasks-page h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
}
.tasks-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 600px) {
  .tasks-grid2 {
    grid-template-columns: 1fr;
  }
}
.task-card {
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 1rem 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 15px;
    border-radius: 15px;
}
.task-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4b5563;
}
.task-difficulty {
  font-size: 0.9rem;
  background: #e5e7eb;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  color: #374151;
}
.task-question {
  flex: 1;
  margin-bottom: 1rem;
  line-height: 1.5;
  color: #111827;
}
.task-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.icon-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.icon-btn img {
  width: 24px;
  height: 24px;
}
.icon-btn:hover {
  transform: scale(1.1);
}

.task-answer,
.task-solution {
  background: #f9fafb;
  border-left: 3px solid #6366f1;
  padding: 0.75rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin-bottom: 0.5rem;
}
.answer-content,
.solution-content {
  margin-top: 0.5rem;
  color: #374151;
}
.task-image,
.solution-image {
  max-width: 100%;
  display: block;
  margin-top: 0.5rem;
}
.task-header.level-1 { background-color: #93c5fd; }   /* Light Blue */
.task-header.level-2 { background-color: #67e8f9; }   /* Cyan */
.task-header.level-3 { background-color: #5eead4; }   /* Teal */
.task-header.level-4 { background-color: #6ee7b7; }   /* Emerald */
.task-header.level-5 { background-color: #a3e635; }   /* Lime */
.task-header.level-6 { background-color: #facc15; }   /* Yellow */
.task-header.level-7 { background-color: #fbbf24; }   /* Amber */
.task-header.level-8 { background-color: #fb923c; }   /* Orange */
.task-header.level-9 { background-color: #f87171; }   /* Red */
.task-header.level-10 { background-color: #c084fc; }  /* Purple */
@media (max-width: 600px) {
  .tasks-grid {
    grid-template-columns: 1fr;
  }
  .task-card {
    padding: 1rem;
            width: 76%;
  }
}
/* Style for completed tasks */
.task-card.completed {
  background-color: #e0f2e9;
  border: 2px solid #34d399;
  opacity: 0.9;
}
.task-card.completed .task-header {
  opacity: 0.8;
}
.task-card.completed .task-number,
.task-card.completed .task-difficulty {
  color: #047857;
}
.task-card.completed .task-question {

  color: #6b7280;
}
/* Aihealueen nappi, kun 10 tehtävää on suoritettu */
.topic-link.topic-complete {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}
.course-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e3a8a;
}
.tasks-button-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.hidden {
  display: none;
}

.quiz-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  margin:15px;
  flex-wrap: wrap;
  justify-content: center;
}
.quiz-nav-btn {
  flex: 0 0 auto;

  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.quiz-nav-btn:hover {
  background: var(--color-primary);
  color: white;
}
.quiz-nav-btn.active {
  background: var(--color-primary);
  color: #eb5050;
}
.quiz-nav-btn.answered {
  background: #9bdb9a;
  color: #064e3b;
  border-color: #064e3b;
}
.quiz-question {
  margin-bottom: 1rem;
      padding: 20px;
}
.quiz-input {
  width: 50%;
  padding: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
      border-radius: 10px;
}
.quiz-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}
.quiz-answer-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-direction: column;
}
.quiz-preview {
  min-width: 4rem;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  font-size: 1.2rem;
}
.quiz-review-question {
  margin: 0.5rem 0;
}
.quiz-review-user,
.quiz-review-correct,
.quiz-review-solution {
  margin: 0.5rem 0 1rem;
  padding: 0.5rem;
  border-radius: 4px;
}
.quiz-review-user.correct {
  background: #d1fae5;
  border: 1px solid #10b981;
}
.quiz-review-user.incorrect {
  background: #fee2e2;
  border: 1px solid #ef4444;
}
.quiz-review-correct {
  background: #f0f9ff;
  border: 1px solid #3b82f6;
}
.quiz-review-solution {
  background: #f9fafb;
  border: 1px solid #9ca3af;
}
.solution-content {
  margin-top: 0.5rem;
}
.quiz-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-direction: column;
}
.quiz-nav-bubbles {
  display: flex;
  gap: 0.5rem;
  margin: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.review-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  border-radius: 50%;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: default;
}

/* Vihreä gradient oikein-kuplille */
.review-nav-btn.correct {
  background: linear-gradient(135deg, #8bc34a, #4caf50);
}

/* Punainen gradient väärin-kuplille */
.review-nav-btn.incorrect {
  background: linear-gradient(135deg, #ef5350, #e53935);
}

/* Hover-efekti, vaikka ei klikattavissa */
.review-nav-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
/* -----------------------------------
   Quiz-attempt-list: korttimainen tyyli
-------------------------------------*/
.attempt-list {
  margin: 2rem auto;
  max-width: 800px;
  padding: 0;
  list-style: none;
}

.attempt-list h3 {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.attempt-list ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding: 0;
}

.attempt-list .attempt-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border: 2px solid var(--color-muted);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.attempt-list .attempt-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-color: var(--color-primary);
}

.attempt-item .att-date,
.attempt-item .att-score,
.attempt-item .att-duration {
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.att-date {
  font-weight: 600;
  color: var(--color-secondary);
}

.att-score {
  font-weight: 700;
  color: var(--color-success);
}

.att-duration {
  font-weight: 500;
  color: var(--color-muted);
}

/* Responsiivisuus */
@media (max-width: 600px) {
  .attempt-list ul {
    grid-template-columns: 1fr;
  }
}
.attempt-item.best {
  border-color: var(--color-success);
  box-shadow: 0 8px 2px rgba(72,187,120,0.4);
  background-color: #adb5ff;
}

.attempt-item.best:hover {
  transform: none; /* voit myös jättää hover-efektin */
}
.review-answer-box {
  display: inline-block;
  background: #1c1414;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  height: 10px;
}
.stats-cards {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.activity-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.activity-controls select {
  padding: .25rem .5rem;
}
.stat-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: bold;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Väritykset korteille */
.stat-tasks {
  border-left: 4px solid #4CAF50;
}

.stat-quiz {
  border-left: 4px solid #2196F3;
}
.stat-users {
  border-left: 4px solid #8E44AD;
}
.stat-skill {
  border-left: 4px solid #FF9800;
}
}
.stat-ai {
  border-left: 4px solid #e91e63;
}

.ai-help-course tbody tr {
  cursor: default;
}
.ai-help-course tbody tr:hover td:first-child::before {
  content: '';
}
.cc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 2.5rem;
  background: #f6fafd;
  border-radius: 22px;
  box-shadow: 0 3px 18px -8px #9dd8f81a;
  overflow: hidden;
}

.cc-header {
  background: #e1effc;
  color: #1460aa;
  font-weight: 600;
  text-align: center;
  padding: 0.5em 0 0.4em 0;
  font-size: 1.01rem;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.01em;
}

.cc-cell {
  min-height: 88px;
  background: #fff;
  border-radius: 11px;
  border: 1.2px solid #d7e7f3;
  box-shadow: 0 1px 5px #aad2ee0d;
  padding: 6px 7px 5px 7px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.18s, border-color 0.16s, background 0.16s;
  cursor: pointer;
}
.cc-cell:hover:not(.empty):not(.done-cell) {
  box-shadow: 0 2px 8px #84bee033;
  border-color: #73bdf7;
  background: #f0f9ff;
  z-index: 2;
}

.cc-cell.empty {
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: default;
}

.cc-date {
  font-size: 1.06rem;
  font-weight: 600;
  color: #1976d2;
  opacity: 0.86;
  margin-bottom: 1px;
}

.cc-topic {
  margin-top: 6px;
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  color: #2676c6;
  background: #e9f4ff;
  border-radius: 7px;
  padding: 0.23em 0.7em;
  box-shadow: 0 1px 3px #acd5fc19;
  display: block;
  transition: background 0.16s, color 0.12s;
}
.cc-topic:hover {
  background: #bde7ff;
  color: #004e9e;
}

.cc-status {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 1.19em;
  font-weight: 600;
  opacity: 0.88;
  letter-spacing: 0.02em;
}
.cc-status.pending {
  color: #b8cbe6;
  text-shadow: 0 1px 1px #fff;
}
.cc-status.done {
  color: #38c172;
  text-shadow: 0 1px 3px #d1f7e8cc;
}

.done-cell {
  background: linear-gradient(135deg, #eafcec 55%, #e5ffe7 100%);
  border: 1.3px solid #c0f6c2;
  opacity: 0.98;
}

.cc-target-cell {
  border: 2.5px solid #20be64;
  border-radius: 13px;
  box-shadow: 0 0 0 2px #a4fad01a;
}

.today-cell {
  border: 2.5px solid #3c7efd;
  box-shadow: 0 0 0 3px #b5d8ff1a;
  border-radius: 13px;
}

@media (max-width: 900px) {
  .cc-grid { grid-template-columns: repeat(7, 1fr); gap: 5px; }
  .cc-cell { min-height: 62px; font-size: 0.95em; }
}
@media (max-width: 600px) {
  .cc-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .cc-cell { min-height: 38px; padding: 2px 3px 2px 4px; font-size: 0.87em; }
  .cc-date { font-size: 1em; }
  .cc-topic { font-size: 0.86em; padding: 0.15em 0.5em; }
  .cc-status { font-size: 1em; right: 3px; bottom: 2px; }
}
@media (max-width: 480px) {
  #cc-calendar { overflow-x: auto; }
  .cc-grid {
    grid-template-columns: repeat(7, 60px);
    gap: 2px;
    min-width: 430px;
  }
  .cc-cell {
    min-height: 44px;
    padding: 2px;
    font-size: 0.78em;
  }
  .cc-date { font-size: 0.9em; }
  .cc-topic { font-size: 0.78em; padding: 0.1em 0.4em; }
  .cc-status { font-size: 0.95em; }
}
.cc-multi-topic {
  margin-top: 7px;
  font-size: 1.02em;
  color: #265d8e;
  background: #e9f4ff;
  border-radius: 8px;
  padding: 0.18em 0.8em 0.18em 0.7em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px #aad2ee13;
}
.cc-multi-indicator {
  font-size: 1.06em;
  opacity: 0.8;
  margin-left: 1px;
  color: #53a5de;
}
#admin-settings-panel {
  background: #fcf9e4;
  border-radius: 14px;
  box-shadow: 0 4px 14px #f3daad66;
  padding: 2.5rem 2rem 2.2rem 2rem;
  margin-top: 2.2rem;
}
.settings-buttons {
  display: flex;
  gap: 1.4rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
#admin-settings-content {
  font-size: 1.15em;
  color: #555;
}
/* 1. Hakukentät */
.user-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.user-search-form input {
  flex: 1 1 10rem;
  padding: .55rem .9rem;
  border: 1px solid #d0d7de;
  border-radius: .375rem;
  transition: border-color .15s;
}
.user-search-form input:focus {
  outline: none;
  border-color: #6366f1;            /* indigo-sävy */
}

/* 2. Taulukko – yleisilme */
.user-results {
  width: 100%;
  border-collapse: separate;         /* sallii border-radiusin */
  border-spacing: 0;
  overflow: hidden;
  border-radius: .5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  font-size: .95rem;
}

/* 3. Otsikkorivi */
.user-results thead th {
  background: linear-gradient(135deg,#eef2ff 0%,#e0e7ff 100%);
  text-align: left;
  padding: .75rem 1rem;
  font-weight: 600;
  color: #374151;
}

/* 4. Solut */
.user-results td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f3f6;
  white-space: nowrap;
}

/* 5. Joka toinen rivi erisävyinen */
.user-results tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* 6. Klikattavuus – hover + osoitin + nuoli */
.user-results tbody tr {
  position: relative;
  transition: background .18s ease;
  cursor: pointer;                  /* “klikattavissa” */
}
.user-results tbody tr:hover {
  background: #f5f7ff;
}
.user-results tbody tr:hover td:first-child::before {
  content: "➜";                     /* pieni nuoli */
  color: #6366f1;
  margin-right: .45rem;
}

/* 7. Sivutus-napit */
.user-pagination {
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.user-pagination button {
  padding: .45rem .9rem;
  border-radius: .375rem;
  border: 1px solid #d0d7de;
  background: #fff;
  transition: background .15s;
}
.user-pagination button:hover:not(:disabled) {
  background: #f3f4f6;
}
.user-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
/* === 1. Koko kortti === */
.user-detail {
  max-width: 62rem;                /* keskitetty, tiivis leveys */
  margin: 2rem auto;
  padding: 1.75rem 2rem;
  background: #ffffff;
  border-radius: .75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  display: grid;
  gap: 1.5rem;
  font-size: .95rem;
}

/* === 2. Perustiedot kahdessa sarakkeessa === */
.user-detail h3 {
  font-size: 1.5rem;
  margin: 0 0 .25rem;
  color: #111827;
}
.user-basic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem 1.25rem;
}
.user-basic p { margin: 0; }

/* === 3. Kurssisuunnitelmat korttina === */
.user-plan {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-left: .25rem solid #6366f1;      /* indigo-korostus */
  border-radius: .5rem;
  padding: .85rem 1.15rem;
}
.user-plan > b { font-weight: 600; color: #374151; }
.user-plan ul {
  margin: .3rem 0 0;
  padding-left: 1.25rem;
  line-height: 1.4;
}

.plans-attempts {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.plans-column, .attempts-column {
  flex: 1 1 20rem;
}

.topic-completed {
  color: #047857;
  font-weight: 600;
}

.topic-overdue {
  color: #dc2626;
}

/* === 4. Tenttiyritykset “accordion”-korteiksi === */
details.quiz-group {
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  background: #ffffff;
  overflow: hidden;
  margin-top: .75rem;
}

details.quiz-group summary {
  cursor: pointer;
  user-select: none;
  list-style: none;                /* piilota oletuksena oleva nuoli */
  padding: .75rem 1rem;
  background: #eef2ff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #374151;
}
details.quiz-group[open] summary {
  border-bottom: 1px solid #e5e7eb;
}

/* Korvaava nuoli */
details.quiz-group summary::before {
  content: "▶";
  font-size: .8rem;
  transition: transform .2s ease;
}
details.quiz-group[open] summary::before {
  transform: rotate(90deg);
}

details.quiz-group ul {
  margin: 0;
  padding: .8rem 1.3rem;
  background: #ffffff;
}
details.quiz-group li { padding: .25rem 0; }

/* Parhaan tuloksen korostus */
.quiz-best {
  color: #047857;                  /* tailwind emerald-sävy */
  font-weight: 600;
}

/* === 5. Toimintonapit oikeaan laitaan === */
.user-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}
.user-detail-actions .btn {
  padding: .55rem 1rem;
  border-radius: .375rem;
}

.btn-warning {
  background: #ffbb54;
  color: #5d3d00;
  border: 1.5px solid #fcb44f;
  box-shadow: 0 2px 8px #f8e3c44f;
}
.btn-warning:hover {
  background: #ffdeab;
}

      /* Yläheaderin tausta ja pohja */
.cc-headerbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: linear-gradient(90deg, #eef3fa 70%, #d1e7fd 100%);
  border-radius: 22px;
  padding: 1.2rem 2.1rem 1.2rem 2.1rem;
  margin-bottom: 2.1rem;
  box-shadow: 0 6px 18px -5px #7ac0ee33;
  position: relative;
  flex-wrap: wrap;
}

/* Ryhmitetyt elementit */
.cc-header-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* "Valmistun"-label */
.cc-header-label {
  font-weight: 500;
  font-size: 1.1rem;
  color: #21456d;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.25em;
}

/* Kalenteri-ikoni */
.cc-header-icon {
  vertical-align: -4px;
  margin-right: 4px;
}

/* Päivämäärä-tyyli */
#cc-date.cc-header-date {
  font-size: 1.18rem;
  font-weight: 600;
  color: #00356b;
  background: #e8f1fc;
  border-radius: 8px;
  padding: 0.31em 1.2em;
  letter-spacing:0.02em;
  box-shadow: 0 2px 8px #c8e8ff18;
  margin-left: 0.2em;
}

/* Checkbox-ryhmä */
.cc-header-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1rem;
  color: #234;
  user-select: none;
}
.cc-header-checkbox input[type="checkbox"] {
  accent-color: #3184d8;
  width: 1.19em;
  height: 1.19em;
  margin-right: 0.15em;
  cursor: pointer;
}

/* Nappien ulkoasu */
.cc-header-btn {
  background: #fff;
  font-weight: 500;
  border: 1.2px solid #a9d4fb;
  border-radius: 9px;
  padding: 0.46em 1.2em;
  margin-left: 0.25em;
  box-shadow: 0 1px 7px 0 #67c6f218;
  transition: all 0.13s;
  cursor: pointer;
  font-size: 1.06rem;
  line-height: 1.1em;
}
.cc-header-btn-edit {
  color: #1760a0;
}
.cc-header-btn-edit:hover {
  background: #eaf6fe;
  border-color: #79c1fc;
}
.cc-header-btn-delete {
  color: #e74a5a;
  border-color: #ffc4cc;
  padding-left: 1.04em;
  padding-right: 1.04em;
  font-size: 1.28em;
  font-weight: bold;
}
.cc-header-btn-delete:hover {
  background: #ffe3e7;
  border-color: #fd909a;
}

/* Responsiivisuus */
@media (max-width: 700px) {
  .cc-headerbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.05rem 1rem 1.2rem 1rem;
  }
  .cc-header-group {
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .courses-page {
    padding: 2rem 1rem;
  }
  .courses-page h2 {
    font-size: 2rem;
  }
}
/* Group management */
.group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.group-card {
  background: #fff;
  border-radius: .75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  flex: 1 1 220px;
  border-left: 5px solid var(--type-color, #e5e7eb);
}

.group-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.group-card h4 {
  margin: 0 0 .25rem;
  color: #111827;
}

.group-type-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: 0.1rem 0.4rem;
  border-radius: .25rem;
  font-size: .75rem;
  background: var(--type-color, #e5e7eb);
  color: #111827;
}

.group-card p {
  margin: 0;
  color: #374151;
  font-size: .9rem;
}

.group-detail {
  max-width: 60rem;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-top: 4px solid var(--type-color, #e5e7eb);
}

.group-users tbody tr td:last-child {
  width: 1%;
  white-space: nowrap;
}

.group-actions {
  margin-bottom: 1rem;
}
.group-form {
  max-width: 28rem;
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.group-form input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}
/* Tehtävälistat käyttäjätiedoissa */
.user-plan .task-levels {
  display: none;
  margin-top: .25rem;
}
.user-plan .task-level {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  margin: 0 0.15rem;
  border-radius: 4px;
  background: #e5e7eb;
  font-size: .85rem;
}
.user-plan .task-level.done {
  background: #d1fae5;
  color: #065f46;
}
.task-level {
  transition: all 0.2s ease-in-out;
}

.task-level:hover {
  cursor: pointer;
  background-color: #f5f5f5; /* kevyt vaalennus */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* pieni varjo */
  transform: translateY(-1px); /* kevyt kohoaminen */
}
/* AI Helper */
.ai-spinner {
  border: 4px solid #d1d5db;
  border-top: 4px solid #6366f1;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: ai-spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}
/* Courses page layout */
.selected-course-container {
  margin-bottom: 2rem;
}
.selected-course-card {
  max-width: 600px;
  margin: 0 auto;
}
.other-courses .course-card {
  transform: scale(0.95);
}
/* VAIHTOEHTO 1: MINIMALISTINEN JA AMMATTIMAINEN */

/* 1. Ruudukon perusasetukset (sama kuin ennen) */
#course-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0;
  list-style-type: none;
  margin-top: 2rem;
}

/* 2. Kortin ulkoasu */
#course-selection-grid .course-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  /* Lisätään yläreunaan läpinäkyvä reunus, joka saa värin hoverissa */
  border-top: 4px solid transparent;
}

/* 3. Kortin hover-efekti */
#course-selection-grid .course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 7px 15px rgba(0, 0, 0, 0.08);
  /* Yläreuna saa värin, kun hiiri on päällä */
  border-top-color: #4A90E2; /* Voit vaihtaa tämän teemasi pääväriin */
}

/* 4. Linkin tyyli kortin sisällä (TÄRKEÄ KORJAUS) */
#course-selection-grid .course-card a {
  /* Nollataan KAIKKI vanhat nappityylit */
  background: none !important;
  border: none !important;
  box-shadow: none !important;

  /* Asetellaan sisältö */
  display: flex;
  flex-direction: column; /* Asettaa sisällön allekkain, jos lisäät ikonin */
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  padding: 1.5rem;
  box-sizing: border-box; /* Varmistaa, että padding lasketaan kokoon mukaan oikein */

  /* Tekstin tyylit */
  color: #333;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* 5. Muutetaan tekstin väriä hoverilla */
#course-selection-grid .course-card:hover a {
  color: #4A90E2; /* Sama väri kuin yläreunassa */
}
/* =============================================== */
/* KOKEEN LUONTISIVUN UUDET TYYLIT                  */
/* =============================================== */

/* 1. Aihealueiden "harmonikka" -valikko
----------------------------------------------- */
.topic-title {
  background: #f3f4f6;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1.5rem;
  margin-bottom: 0;
  transition: all 0.2s ease-out;
  display: flex; /* Mahdollistaa ikonin ja tekstin asettelun */
  justify-content: space-between; /* Asettaa ikonin oikeaan reunaan */
  align-items: center;
  border: 1px solid #e5e7eb;
}

/* Lisätään "+" -ikoni, joka kertoo avattavasta osiosta */
.topic-title::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: #6b7280;
  transition: transform 0.3s ease;
}

/* Kun osio on auki (vaatii JS-luokan lisäyksen), ikoni muuttuu miinukseksi */
.topic-title.active::after {
  content: '−';
  transform: rotate(180deg);
}

.topic-title:hover {
  background-color: #e9eaf0;
  border-color: #d1d5db;
}

/* Itse avautuva osio, jossa on tasot ja tehtävät */
.topic-section {
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 1rem;
  background-color: #fafafa;
}

/* 2. Tason valintanapit
----------------------------------------------- */
.level-buttons {
  display: flex;
  gap: 0.5rem; /* Parempi tapa luoda väliä kuin margin */
  margin-bottom: 1.5rem;
}

.level-btn {
  background-color: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  transition: all 0.2s ease-out;
}

.level-btn:hover:not(.active) {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Aktiivisen napin tyyli (hieman paranneltu) */
.level-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* 3. Tehtäväruudukko ja -kortit
----------------------------------------------- */
.tasks-grid {
  display: grid;
  /* Responsiivinen grid: 2 saraketta, jos tilaa riittää, muuten 1 */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.exam-select-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* Väli kortin sisällön välillä */
}

.exam-select-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Valitun kortin korostus */
.exam-select-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); /* Selkeämpi "hohde" */
  transform: translateY(0);
}

.task-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.task-question {
  flex-grow: 1; /* Varmistaa, että kortit ovat saman korkuisia */
  line-height: 1.5;
}

.task-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 0.5rem;
  border: 1px solid #eee;
}

/* 4. Lähetysnappi ja muut
----------------------------------------------- */
#create-exam-btn {
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

#selected-count {
  font-weight: bold;
}
.student-info {
  margin-bottom: 1rem;
  display: flex;
  gap: 2rem;
}
@media (max-width: 600px) {
  .student-info {
    flex-direction: column;
    gap: 1rem;
  }
}

.exam-task {
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .exam-task {
    padding-left: 0;
    padding-right: 0;
  }
  .answer-grid {
    height: 8rem;
  }
}

.task-number {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.answer-grid {
  border: 1px solid #000;
  height: 10rem;
  margin-top: 1rem;
  /* Poistetaan vanha gradientti ja korvataan se tarkalla SVG-kuvalla */
   background-image: url("/static/images/ans.png");
  background-repeat: repeat; /* Varmistetaan, että kuvio toistuu */
   -webkit-print-color-adjust: exact; /* Varmistaa taustojen tulostumisen Chromessa ja Safarissa */
  print-color-adjust: exact; /* Virallinen standardi samaan tarkoitukseen */
}

.error-report-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.error-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  padding: 1rem;
}
.beta-request-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.beta-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  padding: 1rem;
}
.no-print {
}

.print-only {
  display: none;
}
.instructions-page {
  max-width: 800px;
  margin: auto;
  padding: 2rem;
}

.instructions-page h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.instruction-steps {
  list-style: decimal inside;
}

.instruction-steps li {
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 4px solid #007bff;
  margin-top: 10px;
}

.instruction-steps p {
  font-size: 1rem;
  line-height: 1.6;
}

strong {
  color: #0056b3;
}


@media print {
  #footer-exam-uid {
    string-set: exam_uid_var content(text);
  }
@page {
    size: A4;
    margin: 1.5cm; /* Käytetään senttimetrejä */
    margin-bottom: 2.5cm;

    @bottom-left {
      content: "MatikkapajaX | Toni Tran"; /* Staattinen teksti */
      font-size: 10pt;
      color: #666;
    }
     @bottom-right {
      content: "Tunniste: " string(exam_uid_var);
      font-size: 10pt;
      color: #666;
    }
     }
   .exam-task {
    margin-top: 0.8cm;
    /* TÄMÄ ON AVAINASEMA: Estää sivunvaihdon tehtävän sisällä */
    page-break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  .page-break {
    page-break-before: always;
  }
  body {
    background: white;
    font-family: 'Times New Roman', serif;
    font-size: 10pt; /* Käytetään pisteitä, joka on standardi tulostuksessa */
    color: #000;
  }

}





