.htc-course-container {
  max-width: 700px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px #0002;
  padding: 32px 24px;
  font-family: 'Heebo', Arial, sans-serif;
  direction: rtl;
}
#lesson-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 1.3em;
  margin-bottom: 12px;
}
#lesson-header button {
  background: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2em;
  cursor: pointer;
  transition: background 0.2s;
}
#lesson-header button:disabled { opacity: 0.5; cursor: not-allowed; }
#lesson-header button:hover:not(:disabled) { background: #2563eb; }
#lesson-title { font-weight: bold; }
#lesson-description { color: #444; margin-bottom: 18px; }
#exercise-area { margin-bottom: 24px; }
#exercise-title { font-size: 1.1em; font-weight: bold; margin-bottom: 4px; }
#exercise-description { color: #666; margin-bottom: 8px; }
#text-to-type {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 16px;
  font-size: 1.2em;
  margin-bottom: 8px;
  min-height: 40px;
  letter-spacing: 2px;
  direction: rtl;
}
#typing-input {
  width: 100%;
  font-size: 1.1em;
  padding: 10px;
  border: 2px solid #4f8cff;
  border-radius: 8px;
  margin-bottom: 10px;
  direction: rtl;
}
#exercise-stats {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
  font-size: 1em;
  color: #333;
}
#next-exercise {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 24px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
#next-exercise:hover { background: #16a34a; }
#keyboard-area {
  margin: 32px 0 12px 0;
  text-align: center;
}
.virtual-keyboard {
  display: inline-block;
  background: #e0e7ef;
  border-radius: 12px;
  padding: 18px 12px;
  box-shadow: 0 2px 12px #0001;
}
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.keyboard-key, .key {
  background: #fff;
  border: 2px solid #b6c6e0;
  border-radius: 6px;
  min-width: 36px;
  min-height: 36px;
  font-size: 1.1em;
  font-weight: bold;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border 0.15s;
  cursor: pointer;
  user-select: none;
}
.keyboard-key.focus, .key.focus {
  background: #4f8cff;
  color: #fff;
  border-color: #2563eb;
}
.keyboard-key.pressed, .key.pressed {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}
.hand-visual {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 0 0;
}
.finger {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95em;
  color: #333;
  text-align: center;
  min-width: 48px;
}
.finger-letter {
  font-size: 1.2em;
  font-weight: bold;
  color: #4f8cff;
}
.focus-in-text {
  color: #4f8cff;
  font-weight: bold;
  text-decoration: underline;
}
.ttc-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0007;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.ttc-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 4px 32px #0003;
  text-align: center;
  min-width: 260px;
}
#ttc-modal-message {
  font-size: 1.1em;
  margin-bottom: 18px;
  display: block;
}
#ttc-modal-close {
  background: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 24px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
#ttc-modal-close:hover { background: #2563eb; }
@media (max-width: 600px) {
  #ttc-course-container { padding: 10px; }
  .keyboard-row { gap: 2px; }
  .key, .keyboard-key { min-width: 28px; min-height: 28px; font-size: 0.9em; }
  .key.space { min-width: 100px; }
}

/* Lesson Container Styles */
.lesson-header {
  text-align: center;
  margin-bottom: 30px;
}

.lesson-title {
  font-size: 2em;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.lesson-subtitle {
  color: #666;
  font-size: 1.1em;
}

.lesson-letters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.letter {
  background: #4f8cff;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.2em;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.statistics-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-card {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #4f8cff;
  margin-bottom: 5px;
}

.stat-label {
  color: #666;
  font-size: 0.9em;
}

.text-areas {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.exercise-status {
  text-align: center;
  margin-bottom: 15px;
}

.exercise-status h4 {
  color: #333;
  margin-bottom: 5px;
}

.text-line {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 20px;
  font-size: 1.2em;
  min-height: 60px;
  line-height: 1.6;
  direction: rtl;
}

.typing-line {
  border: 2px solid #4f8cff;
  border-radius: 8px;
  padding: 15px;
  font-size: 1.1em;
  min-height: 60px;
  direction: rtl;
  outline: none;
}

.typing-line:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.progress-bar {
  background: #e5e7eb;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #4f8cff, #7c3aed);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.buttons-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: #4f8cff;
  color: white;
}

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

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.keyboard-section {
  margin-top: 30px;
  text-align: center;
}

.message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 300px;
}

.message-content {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-left: 4px solid #4f8cff;
}

.error-message {
  text-align: center;
  padding: 40px;
  color: #dc2626;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  direction: rtl;
}

.dashboard-header {
  background: linear-gradient(135deg, #4f8cff, #7c3aed);
  color: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  text-align: center;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #4f8cff;
  margin-bottom: 10px;
}

.stat-label {
  color: #666;
  font-size: 1.1em;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.lesson-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

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

.lesson-card.completed {
  border-left: 4px solid #22c55e;
}

.lesson-card.in-progress {
  border-left: 4px solid #f59e0b;
}

.lesson-card.locked {
  opacity: 0.6;
  pointer-events: none;
}

.lesson-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.lesson-description {
  color: #666;
  margin-bottom: 15px;
}

.lesson-progress {
  background: #f3f4f6;
  border-radius: 8px;
  height: 8px;
  margin-bottom: 10px;
}

.progress-bar {
  background: linear-gradient(90deg, #4f8cff, #7c3aed);
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s;
}

.lesson-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s;
}

.btn-primary {
  background: #4f8cff;
  color: white;
}

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

.btn-success {
  background: #22c55e;
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

/* Form Styles */
.form-container {
  max-width: 500px;
  margin: 40px auto;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  direction: rtl;
}

.form-title {
  text-align: center;
  font-size: 1.5em;
  margin-bottom: 30px;
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #4f8cff;
}

.form-error {
  color: #dc2626;
  font-size: 0.9em;
  margin-top: 5px;
}

.form-success {
  color: #16a34a;
  font-size: 0.9em;
  margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .lessons-grid {
    grid-template-columns: 1fr;
  }
  
  .form-container {
    margin: 20px;
    padding: 20px;
  }
}