/* Workshop PWA Main Styles */

/* CSS Custom Properties for easy dark mode maintenance */
:root {
  /* Light mode colors */
  --bg-primary: #e8e9eb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f4;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e9ecef;
  --border-light: #ddd;
  --shadow: rgba(0,0,0,0.1);
  
  /* Brand colors (stay consistent) */
  --brand-primary: #fdc844;
  --brand-yellow: #fdc844;
  --brand-orange: #e39425;
  
  /* Link colors */
  --link-color: #fdc844;
  --link-hover-color: #e39425;
  
  /* Official colors for messages, ribbons, etc */
  --color-red: #e08686;
  --color-green: #9ad795;
  --color-blue: #4c94c4;
  
  /* Button colors */
  --btn-secondary-bg: #f8f9fa;
  --btn-secondary-text: #333333;
  --btn-secondary-border: #dee2e6;
  
  /* Border radius consistency */
  --border-radius: 0.25rem;
}

/* Dark Mode Variables */
.dark-mode {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --border-color: #444444;
  --border-light: #555555;
  --shadow: rgba(255,255,255,0.1);
  
  /* Dark mode button colors */
  --btn-secondary-bg: #444444;
  --btn-secondary-text: #ffffff;
  --btn-secondary-border: #666666;
}

/* Font Declarations */
@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira/FiraSans-Light.woff2') format('woff2'),
       url('../fonts/fira/FiraSans-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira/FiraSans-Medium.woff2') format('woff2'),
       url('../fonts/fira/FiraSans-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira/FiraSans-ExtraBold.woff2') format('woff2'),
       url('../fonts/fira/FiraSans-ExtraBold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Global link styles */
a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

a:visited {
  color: var(--link-color);
  opacity: 0.9;
}

/* Layout containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* App layout when logged in (with footer) should prevent body scroll */
.app-layout.with-footer {
  height: 100vh;
  overflow: hidden;
}

/* Content transition animations */
.content-transition {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

.content-transition.fade-out {
  opacity: 0;
}

.content-transition.fade-in {
  opacity: 1;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  width: 32px;
  height: 32px;
}

.header-title {
  font-weight: 800;
  font-size: clamp(1rem, 4vw, 1.8rem);
  color: var(--text-primary);
  text-align: center;
  flex: 1;
  margin: 0 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hamburger-menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  font-size: 1.5rem;
}

/* Main content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-shrink: 0;
}

.footer-nav {
  display: flex;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  gap: min(3rem, 12vw);
}

a.footer-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  color: #999;
  font-weight: 500;
  transition: all 0.2s;
  font-size: min(1.2rem, 5.5vw);
}

.footer-nav-item.active {
  color: #fdc844;
}

.footer-nav-item img {
  width: min(2.5rem, 9vw);
  height: min(2.5rem, 9vw);
}

.footer-nav-label {
  margin-left: 8px;
}

/* Welcome page */
.welcome-section {
  text-align: center;
  padding: 4rem 0;
}

.welcome-title {
  font-size: 3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.welcome-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.video-container {
  max-width: 600px;
  margin: 0 auto 3rem;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

/* Forms */
.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 2px rgba(253, 220, 0, 0.2);
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  vertical-align: middle;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: background-color 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--bg-primary);
  transition: transform 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #fdc844;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch.disabled .toggle-slider {
  cursor: not-allowed;
}

/* Custom Checkbox Styles */
.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  height: 24px;
  width: 24px;
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.checkbox-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 24px; /* Match checkbox height for alignment */
}

/* Hover state */
.checkbox-label:hover .checkbox-custom {
  border-color: #fdc844;
}

/* Checked state */
.checkbox-label input:checked ~ .checkbox-custom {
  background-color: #fdc844;
  border-color: #fdc844;
}

/* Checkmark */
.checkbox-label input:checked ~ .checkbox-custom:after {
  content: "";
  position: absolute;
  display: block;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Disabled state */
.checkbox-label input:disabled ~ .checkbox-custom {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label input:disabled ~ .checkbox-text {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Notification settings container */
.notification-settings-container {
  /* No margin auto - left aligned */
}

@media (max-width: 768px) {
  .notification-settings-container {
    max-width: 100%;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--brand-primary);
  color: #333;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Fira Sans', sans-serif;
  cursor: pointer;
}

/* Force all buttons to use Fira Sans */
button {
  font-family: 'Fira Sans', sans-serif;
}

input[type="button"],
input[type="submit"],
input[type="reset"] {
  font-family: 'Fira Sans', sans-serif;
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}

.btn-full {
  width: 100%;
}

/* Training Overview Styles */
.training-overview-title {
  text-align: center;
  margin: 2rem 0;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.welcome-video-container {
  margin-bottom: 2rem;
}

.welcome-links {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
}

.welcome-links p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.link-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background 0.2s;
}

.link-button:hover {
  background: var(--brand-primary);
  color: #000;
}

.section-title {
  text-align: center;
  margin: 2rem 0;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.training-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px var(--shadow);
  position: relative;
}

.training-card:hover {
  box-shadow: 0 12px 24px var(--shadow);
}

.training-card.featured {
  position: relative;
  border: 3px solid var(--brand-yellow) !important;
  box-shadow: 0 2px 20px var(--shadow);
  overflow: visible !important;
}

.training-card.featured:hover {
  box-shadow: 0 12px 30px var(--shadow);
}

.training-card.featured::before {
  content: attr(data-featured-type);
  position: absolute;
  top: -8px;
  left: 16px;
  background: var(--bg-secondary);
  padding: 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 8px;
  z-index: 10;
}

.training-card-poster-container {
  position: relative;
  width: 100%;
  height: 180px;
}

.training-card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play button overlay removed - using native video controls */

/* Ribbon with tail */
.training-ribbon {
  position: absolute;
  top: 20px;
  left: 0;
  padding: 8px 24px 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 2;
  transition: all 0.3s ease;
  opacity: 1;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Bigger ribbon for training videos */
.training-video-wrapper .training-ribbon {
  top: 24px;
  padding: 10px 28px 10px 20px;
  font-size: 1.5rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.ribbon-lesson {
  background: var(--brand-primary);
  color: rgba(0, 0, 0, 0.9);
}

.ribbon-demo {
  background: var(--color-red);
  color: white;
}

.ribbon-how-to {
  background: var(--color-blue);
  color: white;
}

.ribbon-announcement {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.training-card-content {
  padding: 1rem;
}

.training-card-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.training-card-type {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
  font-weight: 300;
  display: flex;
  align-items: center;
}

.duration-icon {
  margin-right: 0.25rem;
  vertical-align: middle;
}

.training-card-content p:last-child {
  margin: 0;
  font-size: 0.95rem;
}

/* Training Page Styles */
.training-header {
  margin-bottom: 1.5rem;
}

.training-title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
}

.training-video-container {
  margin-bottom: 1.5rem;
}

.training-video {
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--shadow);
}

/* Training Video Wrapper Styles */
.training-video-wrapper {
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--shadow);
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.training-video-wrapper .training-video {
  display: block;
  width: 100%;
  cursor: pointer;
  box-shadow: none;
  margin-bottom: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .training-ribbon {
    font-size: 0.75rem !important;
  }
}

/* Training video styles - play button removed, using native controls */

/* Video ribbon animation */
.training-video-wrapper.playing .training-ribbon {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

.training-description {
  margin-bottom: 2rem;
}

/* Lesson content with markdown */
.lesson-content {
  margin-bottom: 2rem;
  line-height: 1.6;
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.lesson-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.lesson-content a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: underline;
}

.lesson-content a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

.lesson-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.lesson-content p {
  margin-bottom: 1rem;
}

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

.lesson-content code {
  background: var(--bg-tertiary);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: monospace;
}

.lesson-content pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
}

/* Prompt boxes */
.prompt-box {
  background: var(--bg-secondary);
  border: 2px solid var(--brand-primary);
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  overflow: hidden;
  position: relative;
}

.prompt-box-header {
  background: var(--brand-primary);
  color: #000;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prompt-content {
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  margin: 0;
}

.copy-btn {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.copy-btn:hover {
  background: rgba(0, 0, 0, 0.3);
}

.copy-btn.copied {
  background: rgba(0, 255, 0, 0.3);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* Chat interface */
.chat-container {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: var(--border-radius);
}

.chat-messages {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px var(--shadow);
  margin-bottom: 2px;
  word-wrap: break-word;
  position: relative;
}

.message.own {
  align-self: flex-end;
  background: var(--brand-primary);
  color: #333;
}

.message.other {
  align-self: flex-start;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.message-author {
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 4px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-author.instructor {
  font-weight: 600;
}

.message.instructor {
  position: relative;
  border: 2px solid var(--brand-primary);
  border-radius: 18px;
}

.message.instructor::before {
  content: 'Instructor';
  position: absolute;
  top: -8px;
  left: 16px;
  background: var(--bg-primary);
  padding: 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  border-radius: 8px;
}

.profile-picture {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.message-timestamp {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 1rem;
  margin-top: 0.25rem;
  text-align: left;
  padding-left: 0;
  max-width: 70%;
}

.message-timestamp.own {
  text-align: right;
  padding-left: 0;
  padding-right: 0;
  margin-left: auto;
}

/* Message reactions */
.message-reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reaction-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-badge:hover {
  background: var(--bg-secondary);
  transform: scale(1.05);
}

.reaction-badge.user-reacted {
  background: #e0e0e0;
  color: #333;
  border-color: #d0d0d0;
}

/* Dark mode adjustment for user reactions */
.dark-mode .reaction-badge.user-reacted {
  background: #505050;
  color: #fff;
  border-color: #606060;
}

/* Reply indicator */
.reply-to {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--color-blue);
  padding: 4px 8px;
  margin-bottom: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: 0 4px 4px 0;
}

/* Message actions */
.message-actions {
  position: absolute;
  bottom: -28px;
  right: 0;
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 10;
}

.message.own .message-actions {
  right: auto;
  left: 0;
}

/* For other messages (left side), anchor to left */
.message.other .message-actions {
  left: 0;
  right: auto;
}

/* For own messages (right side), keep default - anchor to right */
.message.own .message-actions {
  right: 0;
  left: auto;
}

.message:hover .message-actions,
.message-actions.visible {
  opacity: 1;
  pointer-events: auto;
}

.message-action-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  color: var(--text-secondary);
}

.message-action-btn:hover {
  background: var(--bg-tertiary);
}

.message-action-btn svg {
  width: 16px;
  height: 16px;
}


/* Load more messages button with horizontal divider */
.load-more-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  text-align: center;
}

.load-more-divider::before,
.load-more-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.load-more-button {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  margin: 0 16px;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chat-input-container {
  padding: 1rem 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 10rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  overflow-y: hidden;
}

.chat-send-btn {
  padding: 12px;
  background: var(--brand-primary);
  border: none;
  border-radius: 50%;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Lessons */
.training-container {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px var(--shadow);
}

.training-page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.training-selector-container {
  margin-bottom: 2rem;
}

.training-selector {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: 'Fira Sans', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23fdc844' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 24px;
  padding-right: 40px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
}

.training-selector:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 2px rgba(253, 220, 0, 0.2);
}

.training-selector option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: 'Fira Sans', sans-serif;
  white-space: normal;
  word-wrap: break-word;
}

/* Mobile responsive adjustments for lesson selector */
@media (max-width: 768px) {
  .training-selector {
    font-size: 0.9rem;
    padding: 10px;
    padding-right: 35px;
    min-height: 44px;
  }
  
  .training-selector option {
    padding: 6px 10px;
  }
}

/* Handled in new training styles above */
  width: 100%;
  margin-bottom: 2rem;
}

/* Handled in new training styles above */
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius);
}

/* Handled in new training styles above */
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.discussion-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 2rem 0 1rem 0;
  text-align: center;
}

.training-transcript {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--brand-yellow);
}

.training-transcript h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Settings page */
.settings-container {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 2px 10px var(--shadow);
}

.settings-container h2 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-weight: 800;
}

/* Offers page */
.offers-container {
  /* Remove container styling to let cards float */
}

.offers-container h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 800;
}

.offer-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px var(--shadow);
}

.offer-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.offer-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.offer-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-primary);
}

/* Offers grid for side-by-side layout */
.offers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* On screens 850px and wider (accounting for 400px images + padding) */
@media (min-width: 850px) {
  .offers-grid .offer-card {
    flex: 1 1 calc(50% - 0.75rem);
    margin-bottom: 0;
  }
}

/* Lesson editor styles */
.lesson-editor-modal {
  width: 90%;
  max-width: 900px;
}

.lesson-editor-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.lesson-editor-modal .modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.lesson-editor-modal .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.lesson-editor-modal .modal-close:hover {
  color: var(--text-primary);
}

.lesson-editor-modal .modal-body {
  max-height: calc(80vh - 120px);
  overflow-y: auto;
  padding: 2rem;
}

.lesson-editor-modal .form-group {
  margin-bottom: 1rem;
}

.lesson-editor-modal .form-group:last-child {
  margin-bottom: 0;
}

.lesson-editor-modal .form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.lesson-editor-modal .form-input,
.lesson-editor-modal select,
.lesson-editor-modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.lesson-editor-modal .form-input:focus,
.lesson-editor-modal select:focus,
.lesson-editor-modal textarea:focus {
  outline: none;
  border-color: var(--brand-yellow);
}

.lesson-editor-modal textarea {
  resize: vertical;
  min-height: 100px;
}

.lesson-editor-modal video,
.lesson-editor-modal img {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.lesson-editor-modal input[type="file"] {
  padding: 0.5rem;
  font-size: 0.9rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 100%;
}

.lesson-editor-modal .media-preview {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  text-align: center;
}

.lesson-editor-modal .upload-progress {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
}

.lesson-editor-modal .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.lesson-editor-modal .checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.lesson-editor-modal .modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.lesson-editor-modal .modal-footer .btn-danger {
  margin-right: auto;
}

/* Two column layout for desktop */
@media (min-width: 768px) {
  .lesson-editor-modal .modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    column-gap: 3rem;
  }
  
  .lesson-editor-modal .form-group.full-width {
    grid-column: 1 / -1;
  }
  
  .lesson-editor-modal .modal-body {
    max-height: calc(80vh - 140px);
  }
  
  /* Stack media uploads in same column */
  .lesson-editor-modal .form-group:nth-child(5),
  .lesson-editor-modal .form-group:nth-child(6) {
    grid-column: 1;
  }
  
  .lesson-editor-modal .form-group:nth-child(7),
  .lesson-editor-modal .form-group:nth-child(8) {
    grid-column: 2;
  }
}

.new-lesson-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.new-lesson-card:hover {
  background: rgba(128, 128, 128, 0.1);
  border-color: var(--brand-yellow) !important;
}

.draft-badge {
  display: inline-block;
  vertical-align: middle;
}

progress {
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
}

progress::-webkit-progress-bar {
  background-color: var(--bg-tertiary);
  border-radius: 10px;
}

progress::-webkit-progress-value {
  background-color: var(--brand-yellow);
  border-radius: 10px;
}

.btn-danger {
  background: var(--color-red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--text-secondary);
}

.btn-primary {
  background: var(--brand-yellow);
  color: #333;
  font-weight: 800;
}

/* Toast messages */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1000;
  max-width: 400px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  border-left: 4px solid var(--brand-primary);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--color-green);
}

.toast-error {
  border-left-color: var(--color-red);
}

.toast-info {
  border-left-color: var(--color-blue);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1199px) {
  .welcome-title {
    font-size: 2.5rem;
  }
  
  .training-overview-title,
  .training-title {
    font-size: 1.5rem;
  }
  
  .nav-menu {
    gap: 1rem;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .main-content {
    padding-top: 1rem;
  }
  
  .message {
    max-width: 85%;
  }
  
  /* Hide message actions on mobile by default */
  .message-actions {
    opacity: 0;
    pointer-events: none;
  }
  
  /* Show actions when visible class is added (for tap) */
  .message-actions.visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Simple button styling for mobile */
  .button-group .btn {
    flex: 1;
    min-width: 140px;
    white-space: nowrap;
  }
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2rem;
  overflow-y: auto;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 0;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  margin: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0.5rem 0;
}

.external-link-url {
  font-family: monospace;
  background: var(--surface-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  word-break: break-all;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Markdown styles for chat messages */
.message-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  position: relative;
}

.message-content.truncated .message-content-inner {
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.message-content.truncated .message-content-inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--background-color));
  pointer-events: none;
}

.message.own .message-content.truncated .message-content-inner::after {
  background: linear-gradient(to bottom, transparent, var(--brand-yellow));
}

.message.other .message-content.truncated .message-content-inner::after {
  background: linear-gradient(to bottom, transparent, var(--surface-color));
}

.dark-mode .message.other .message-content.truncated .message-content-inner::after {
  background: linear-gradient(to bottom, transparent, var(--surface-color));
}

.read-more-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: none;
  border: 1px solid currentColor;
  border-radius: 1rem;
  color: inherit;
  opacity: 0.7;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.read-more-button:hover {
  opacity: 1;
}

.message-content h1 {
  font-size: 1.2em;
  margin: 0.5em 0 0.3em 0;
  font-weight: 600;
}

.message-content h2 {
  font-size: 1.1em;
  margin: 0.5em 0 0.3em 0;
  font-weight: 600;
}

.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  font-size: 1em;
  margin: 0.5em 0 0.3em 0;
  font-weight: 600;
}

.message-content p {
  margin: 0.3em 0;
}

.message-content ul,
.message-content ol {
  margin: 0.3em 0;
  padding-left: 1.5em;
}

.message-content li {
  margin: 0.2em 0;
}

.message-content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.dark-mode .message-content code {
  background: rgba(255, 255, 255, 0.1);
}

.message-content pre {
  background: var(--surface-color);
  padding: 0.75em;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 0.5em 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content blockquote {
  border-left: 3px solid var(--brand-yellow);
  padding-left: 1em;
  margin: 0.5em 0;
  opacity: 0.8;
}

.message-content a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: underline;
}

.message-content a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75em 0;
}

.message-content table {
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: 0.9em;
}

.message-content th,
.message-content td {
  border: 1px solid var(--border-color);
  padding: 0.3em 0.6em;
}

.message-content th {
  background: var(--surface-color);
  font-weight: 600;
}

/* Training Request Form */
.training-request-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-yellow);
}

.form-input[readonly] {
  background: var(--surface-color);
  cursor: not-allowed;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
}

.radio-label input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

.radio-label span {
  color: var(--text-primary);
}

/* Notification bell icon styles */
.notification-bell {
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  width: 20px;
  height: 20px;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.notification-bell svg {
  width: 100%;
  height: 100%;
}

.notification-bell.enabled {
  color: var(--brand-primary);
}

.notification-bell.disabled {
  color: var(--text-secondary);
}

.notification-bell:hover {
  transform: scale(1.1);
}

.notification-bell-container {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

