/* Modern Timeline Game Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fafafa;
  overflow: hidden;
}



.logo-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  position: fixed;
  top: 0;
  right: 1rem;
  z-index: 1000;
}

.logo-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row-reverse;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.study-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-top: 0;
}

.study-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.4;
}

.study-text strong {
  font-weight: 700;
  color: #374151;
}

/* Container Layout */
.container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Subject Selector */
.subject-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40%;
  height: 100%;
  padding: 2rem;
  background-color: #ffffff;
  border-right: 1px solid #e5e5e5;
  gap: 1.5rem;
}

.subject-selector label {
  font-size: 1.1rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.custom-select {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background-color: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#load-game-button {
  padding: 0.75rem 2rem;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#load-game-button:hover:not(:disabled) {
  background-color: #2563eb;
  transform: translateY(-1px);
}

#load-game-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Deck Area */
.deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 40%;
  height: 100%;
  padding: 2rem;
  background-color: #f8fafc;
  border-right: 1px solid #e5e5e5;
  transition: all 0.3s ease;
  gap: 0.375rem;
  min-height: 400px;
}

.next-button {
  padding: 0.5rem 1.5rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-button:hover:not(:disabled) {
  background-color: #4b5563;
  transform: translateY(-1px);
}

.next-button:disabled {
  background-color: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.current-card {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
  padding: 1rem;
}

.current-card .card {
  width: 100%;
  max-width: 280px;
  text-align: center;
  cursor: grab;
  background-color: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.current-card .card:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.back-button {
  padding: 0.5rem 1rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-button:hover:not(:disabled) {
  background-color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.back-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.creator-attribution {
  padding: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  margin-top: 1rem;
}

.creator-attribution:hover {
  opacity: 1;
}

/* Card Area */
.card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 60%;
  height: 100vh;
  padding: 2rem;
  background-color: #ffffff;
  overflow-y: auto;
  position: relative;
  transition: all 0.3s ease;
}

.scroll-spacer {
  height: 6rem;
  width: 100%;
  flex-shrink: 0;
  pointer-events: none;
  /* Remove absolute positioning to make it part of normal flow */
}

@media (min-width: 769px) {
  .scroll-spacer {
    height: 4.5rem; /* Slightly less tall on desktop */
  }
}

.card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  min-height: 200px;
  padding: 1rem 0;
  /* Remove position: relative since scroll spacer is no longer absolute */
}

/* Cards */
.card {
  padding: 1rem 1.5rem;
  margin: 0.5rem 0;
  background-color: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  cursor: grab;
  user-select: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 200px;
  text-align: center;
}

/* Only disable transitions for custom deck dragging, not Sortable.js reordering */


.card:hover:not(.dragged) {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.card:active {
  cursor: grabbing;
}

/* Only apply to custom deck dragging, not Sortable.js reordering */
.dragged:not(.sortable-chosen) {
  cursor: grabbing;
  opacity: 0.5;
  position: fixed;
}

/* Placeholder */
.placeholder {
  padding: 1rem 1.5rem;
  margin: 0.5rem 0;
  border: 2px dashed #3b82f6;
  border-radius: 12px;
  color: #3b82f6;
  font-weight: 500;
  background-color: rgba(59, 130, 246, 0.05);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  text-align: center;
  min-width: 200px;
  transition: none;
}

/* Timeline Arrow */
.timeline-arrow {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.05em;
  animation: pulse 2s infinite;
  z-index: 1000;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
}

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

/* Control Buttons */
.interface-button {
  position: fixed;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 229, 229, 0.8);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1002;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 80px;
}

.interface-button:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.interface-button:active {
  transform: translateY(0);
}

.interface-button svg {
  flex-shrink: 0;
}

.interface-button span {
  white-space: nowrap;
}

.how-to {
  top: 4rem;
  background-color: #6b7280 !important;
  color: #fff !important;
  border-color: #6b7280 !important;
}

.how-to:hover {
  background-color: #4b5563 !important;
  border-color: #4b5563 !important;
}



.subject-toggle {
  top: 1rem;
  background-color: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #fff !important;
}

.subject-toggle:hover {
  background-color: #6d28d9 !important;
  border-color: #6d28d9 !important;
}

.restart-button {
  top: 7rem;
}

.check-results-button {
  position: fixed;
  bottom: 2rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1002;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.check-results-button:hover:not(:disabled) {
  background-color: #059669;
  transform: translateY(-1px);
}

.check-results-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
}

/* Shine animation for check results button */
.check-results-button.shine {
  position: fixed !important;
  overflow: hidden;
}

.check-results-button.shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shine 2s infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Message Box */
.message-box {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  font-family: 'Inter', sans-serif;
  max-width: 90%;
}

.message-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #6b7280;
  transition: color 0.2s ease;
}

.message-close:hover {
  color: #374151;
}

/* Popups */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.popup-box {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', sans-serif;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.popup-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.popup-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.popup-close:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.popup-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
}

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

.popup-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

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

/* Results Summary Styles */
.results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 20px;
  background-color: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.accuracy-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.accuracy-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.accuracy-percentage {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.accuracy-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Feedback Section Styles */
.feedback-section {
  margin-bottom: 20px;
}

.feedback-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.feedback-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-item {
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid;
}

.feedback-item.success {
  background-color: #f0fdf4;
  border-left-color: #10b981;
  color: #065f46;
}

.feedback-item.good {
  background-color: #f0f9ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.feedback-item.okay {
  background-color: #fffbeb;
  border-left-color: #f59e0b;
  color: #92400e;
}

.feedback-item.needs-work {
  background-color: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.feedback-item.tip {
  background-color: #f8fafc;
  border-left-color: #6b7280;
  color: #374151;
}

.feedback-item.note {
  background-color: #f0f9ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.feedback-item ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.feedback-item li {
  margin-bottom: 4px;
}

.popup-results {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  padding: 0.25rem;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  white-space: normal;
  overflow-wrap: break-word;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.2;
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.copy-button:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.copy-button svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

.copy-button.copied {
  background-color: #10b981;
  border-color: #10b981;
}

.copy-button.copied svg {
  color: #ffffff;
}

.copy-confirmation {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #10b981;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.copy-confirmation.show {
  opacity: 1;
}

.order-warning {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  color: #92400e;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.results-content {
  margin: 0;
  padding: 0;
  line-height: 1.2;
  white-space: pre-line;
}

.button-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
}

.resume-button {
  padding: 0.5rem 0.75rem;
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resume-button:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

.resume-button svg {
  width: 14px;
  height: 14px;
}

.restart-button {
  padding: 0.5rem 0.75rem;
  background-color: #f59e0b;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.restart-button:hover {
  background-color: #d97706;
  transform: translateY(-1px);
}

.restart-button svg {
  width: 14px;
  height: 14px;
}

.continue-button {
  padding: 0.5rem 0.75rem;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.continue-button:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
}

.cancel-button {
  padding: 0.5rem 0.75rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.cancel-button:hover {
  background-color: #4b5563;
  transform: translateY(-1px);
}





/* Utility classes */
.hidden {
  display: none !important;
}

.fade-out {
  animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Event date styling */
.event-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Sortable.js styling */
.sortable-ghost {
  /*transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);*/
  color: gray;
  border: 3px solid lightgray;
}

.sortable-fallback {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background-color: #f6f6f6;
  pointer-events: none;
}

/* Desktop-specific styles */
@media (min-width: 769px) {
  .logo-section {
    max-width: 40%;
  }
  
  .study-info {
    max-width: 35%;
    text-align: right;
  }
  
  .study-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Hide mobile study info on desktop */
  .mobile-study-info {
    display: none !important;
  }
  
  /* Show desktop study info on desktop */
  .logo-section .study-info {
    display: flex;
  }
  
  /* Show desktop theme toggle on desktop */
  .logo-title-group .theme-toggle {
    display: flex !important;
  }
  
  .theme-toggle {
    display: flex !important;
    position: fixed !important;
    bottom: 2rem;
    right: 1rem;
    left: auto;
    z-index: 1002;
  }
}

/* Dark Mode */
body.dark-mode {
  background-color: #111827;
  color: #f9fafb;
}



body.dark-mode .site-title {
  color: #f9fafb;
}



body.dark-mode .study-text {
  color: #9ca3af;
}

body.dark-mode .study-text strong {
  color: #d1d5db;
}

body.dark-mode .mobile-study-text {
  color: #9ca3af;
}

body.dark-mode .mobile-study-text strong {
  color: #d1d5db;
}

body.dark-mode .subject-selector {
  background-color: #1f2937;
  border-right-color: #374151;
}

body.dark-mode .subject-selector label {
  color: #e5e7eb;
}

body.dark-mode .deck {
  background-color: #1f2937;
  border-right-color: #374151;
}

body.dark-mode .back-button {
  background-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .back-button:hover:not(:disabled) {
  background-color: #6b7280;
}

body.dark-mode .back-button:disabled {
  background-color: #374151;
  color: #9ca3af;
}

body.dark-mode .creator-attribution {
  color: #9ca3af;
}

body.dark-mode .current-card .card {
  background-color: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .current-card .card:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card-area {
  background-color: #111827;
}

body.dark-mode .card {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .card:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

body.dark-mode .placeholder {
  border-color: #60a5fa;
  color: #60a5fa;
  background-color: rgba(96, 165, 250, 0.1);
}

body.dark-mode .timeline-arrow {
  color: #9ca3af;
}

body.dark-mode .interface-button {
  background-color: rgba(31, 41, 55, 0.9);
  border-color: rgba(55, 65, 81, 0.8);
  color: #f9fafb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}



body.dark-mode .interface-button:hover {
  background-color: rgba(55, 65, 81, 1);
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .restart-button {
  background-color: #f59e0b;
  color: white;
  border-color: rgba(55, 65, 81, 0.8);
}

body.dark-mode .restart-button:hover {
  background-color: #d97706;
  border-color: #60a5fa;
}

body.dark-mode .subject-toggle {
  background-color: #7c3aed !important;
  border-color: #7c3aed !important;
}

body.dark-mode .subject-toggle:hover {
  background-color: #6d28d9 !important;
  border-color: #6d28d9 !important;
}

/* Theme icon switching */
body.dark-mode .theme-icon {
  display: none;
}

body.dark-mode .theme-toggle .sun-icon {
  display: block;
}

body:not(.dark-mode) .theme-icon {
  display: block;
}

body:not(.dark-mode) .theme-toggle .sun-icon {
  display: none;
}

body.dark-mode .theme-toggle .theme-icon {
  display: none;
}

/* Improve dark mode visibility */
body.dark-mode .placeholder {
  color: #e5e7eb;
  border-color: #60a5fa;
  background-color: rgba(96, 165, 250, 0.1);
}

body.dark-mode .popup-box {
  background-color: #1f2937;
  border: 1px solid #374151;
}

body.dark-mode .popup-title {
  color: #f9fafb;
}

body.dark-mode .popup-content {
  color: #d1d5db;
}

body.dark-mode .results-summary {
  background-color: #1f2937;
  border-color: #374151;
}

body.dark-mode .accuracy-label {
  color: #9ca3af;
}

body.dark-mode .stat-number {
  color: #f9fafb;
}

body.dark-mode .stat-label {
  color: #9ca3af;
}

body.dark-mode .feedback-title {
  color: #f9fafb;
}

body.dark-mode .feedback-item.success {
  background-color: #064e3b;
  color: #d1fae5;
}

body.dark-mode .feedback-item.good {
  background-color: #1e3a8a;
  color: #dbeafe;
}

body.dark-mode .feedback-item.okay {
  background-color: #78350f;
  color: #fef3c7;
}

body.dark-mode .feedback-item.needs-work {
  background-color: #7f1d1d;
  color: #fee2e2;
}

body.dark-mode .feedback-item.tip {
  background-color: #374151;
  color: #d1d5db;
}

body.dark-mode .feedback-item.note {
  background-color: #1e3a8a;
  color: #dbeafe;
}

body.dark-mode .popup-results {
  background-color: #111827;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode .copy-button {
  background-color: #1f2937;
  border-color: #374151;
}

body.dark-mode .copy-button:hover {
  background-color: #374151;
  border-color: #4b5563;
}

body.dark-mode .copy-button svg {
  color: #9ca3af;
}

body.dark-mode .order-warning {
  background-color: #451a03;
  border-color: #f59e0b;
  color: #fbbf24;
}

body.dark-mode .message-box {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode .custom-select {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode .custom-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  
  .study-info {
    align-items: center;
  }
  
  .study-text {
    font-size: 0.75rem;
    text-align: center;
  }
  
  .logo {
    width: 28px;
    height: 28px;
  }
  
  .site-title {
    font-size: 1.25rem;
  }
  
  .logo-title-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .logo-title-group .theme-toggle {
    display: none !important;
  }
  
  .logo-section {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    z-index: 999;
    align-items: center;
    justify-content: center;
    height: 4rem;
    width: 100%;
    position: fixed;
    background-color: #fafafa;
    border-bottom: none;
  }
  
  /* When game is loaded, match deck background */
  .logo-section.game-loaded {
    background-color: #f8fafc;
  }
  
  /* Hide desktop study info on mobile */
  .logo-section .study-info {
    display: none !important;
  }
  
  /* Mobile study info styles */
  .mobile-study-info {
    display: block;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  
  .mobile-study-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.4;
  }
  
  .mobile-study-text strong {
    font-weight: 700;
    color: #374151;
  }
  
    .logo-title-group .theme-toggle {
    display: none !important;
  }
  



  
  .theme-toggle {
    display: none;
  }
  
  /* Show desktop theme toggle on desktop */
  @media (min-width: 769px) {
    .theme-toggle {
      display: flex !important;
      position: fixed !important;
      top: 1rem;
      right: 1rem;
      left: auto;
      z-index: 1002;
    }
  }
  
  .container {
    flex-direction: column;
    height: 100vh;
    margin-top: 0;
  }
  
  .subject-selector {
    width: 100%;
    height: calc(100vh - 8rem);
    border-right: none;
    border-bottom: none;
    padding: 0.75rem;
    margin-top: 0;
  }
  
  .deck {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 0.5rem;
    gap: 0.25rem;
    margin-top: 4rem; /* Account for logo section height */
    min-height: auto;
  }
  
  .current-card {
    min-height: 50px;
    max-width: 250px;
  }
  
  .current-card .card {
    padding: 0.5rem;
    font-size: 0.75rem;
    max-width: 230px;
  }
  
  .card-area {
    width: 100%;
    height: calc(100vh - 16rem); /* Account for logo banner (4rem) + deck area (4rem) + extra space */
    padding: 0.5rem;
  }
  
  .card {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-width: 150px;
  }
  
  .placeholder {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-width: 150px;
  }
  
  .interface-button {
    left: 0.5rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.625rem;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .interface-button span {
    display: none;
  }
  
  .interface-button svg {
    width: 14px;
    height: 14px;
  }
  
  .how-to { top: 3.5rem; }
  .theme-toggle { 
    top: 0.5rem; 
    left: auto; 
    right: 0.5rem; 
    z-index: 1001; 
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
  }
  
  .theme-toggle:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
  }
  .subject-toggle { top: 0.5rem; }
  
  .logo-section {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: 0.5rem;
    z-index: 999;
  }
  .restart-button { 
    top: 6.5rem; 
    background-color: #f59e0b;
  }
  .back-button { 
    /* No fixed positioning needed since it's inside deck now */
  }
  
  .check-results-button {
    bottom: 1rem;
    left: 0.5rem;
    padding: 1rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Mobile-specific deck button styles */
  .deck .next-button,
  .deck .back-button,
  .deck .forward-button {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
  }
  
  .popup-box {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .timeline-arrow {
    bottom: 1rem;
    font-size: 0.75rem;
    position: fixed;
  }
  
  body.dark-mode .subject-selector,
  body.dark-mode .deck {
    border-bottom-color: #374151;
  }
  
  /* Dark mode mobile deck positioning */
  body.dark-mode .deck {
    margin-top: 4rem; /* Account for logo section height */
  }
  
  /* Dark mode mobile logo section */
  body.dark-mode .logo-section {
    background-color: #111827;
    border-bottom-color: #374151;
  }
  
  /* Dark mode when game is loaded */
  body.dark-mode .logo-section.game-loaded {
    background-color: #1f2937;
  }
  
  /* Dark mode mobile theme toggle */
  body.dark-mode .theme-toggle {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
  }
  
  body.dark-mode .theme-toggle:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
  }
  
  /* Mobile attribution positioning */
  .attribution-link {
    right: 0.5rem;
    bottom: 0.5rem;
  }
}

/* Attribution link */
.attribution-link {
  position: fixed;
  bottom: 8px;
  font-size: 12px;
  color: #6b7280;
  z-index: 1000;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  /* Align with theme button right edge */
  right: 1rem;
}

.attribution-link:hover {
  opacity: 1;
}

body.dark-mode .attribution-link {
  color: #d1d5db; /* Lighter color for dark mode */
}

/* Import Button */
.import-button {
  background-color: #16a34a;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-style: italic;
  font-weight: normal;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.import-button:hover {
  background-color: #15803d;
}

.import-button:disabled {
  background-color: #9ca3af;
  color: #f9fafb;
  cursor: not-allowed;
}

/* Quizlet Import Popup Styles */
.import-instructions {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
  font-size: 0.875rem;
}

.import-instructions p {
  margin: 0.25rem 0;
}

#quizlet-text {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  margin-bottom: 1rem;
}

#quizlet-text:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.import-options {
  margin-bottom: 1rem;
}

.import-mode, .order-options, .quizlet-sub-options {
  margin-bottom: 1rem;
}

.import-mode {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.mode-selector {
  display: flex;
  background-color: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  width: fit-content;
}

.mode-option {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
}

.mode-option.active {
  background-color: white;
  color: #3b82f6;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.order-options label, .quizlet-sub-options label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
}

#parse-button {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-bottom: 1rem;
}

#parse-button:hover {
  background-color: #2563eb;
}

#preview-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

#preview-section h3 {
  margin-bottom: 1rem;
  color: #374151;
}

#preview-cards {
  margin-bottom: 1rem;
}

.preview-card {
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.preview-card .card-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.preview-card .card-date {
  color: #6b7280;
  font-size: 0.75rem;
}

.deck-name-input {
  margin-bottom: 1rem;
}

.deck-name-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
}

.deck-name-input input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.deck-name-input input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button-holder {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.button-holder button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.button-holder button:first-child {
  background-color: #10b981;
  color: white;
  border: 1px solid #10b981;
}

.button-holder button:first-child:hover {
  background-color: #059669;
  border-color: #059669;
}

.button-holder button:last-child {
  background-color: #6b7280;
  color: white;
  border: 1px solid #6b7280;
}

.button-holder button:last-child:hover {
  background-color: #4b5563;
  border-color: #4b5563;
}

/* Dark mode styles for Quizlet import */
body.dark-mode .import-instructions {
  background-color: #1f2937;
  border-left-color: #60a5fa;
}

body.dark-mode #quizlet-text {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode #quizlet-text:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.dark-mode #preview-section h3 {
  color: #e5e7eb;
}

body.dark-mode .preview-card {
  background-color: #1f2937;
  border-color: #374151;
}

body.dark-mode .preview-card .card-name {
  color: #f9fafb;
}

body.dark-mode .preview-card .card-date {
  color: #9ca3af;
}

body.dark-mode .deck-name-input label {
  color: #e5e7eb;
}

body.dark-mode .deck-name-input input {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode .deck-name-input input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Dark mode styles for import button */
body.dark-mode .import-button {
  background-color: #16a34a;
  color: white;
  border: none;
}

body.dark-mode .import-button:hover {
  background-color: #15803d;
}

body.dark-mode .import-button:disabled {
  background-color: #6b7280;
  color: #f9fafb;
}

/* Dark mode styles for mode selector */
body.dark-mode .mode-selector {
  background-color: #374151;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mode-option {
  color: #9ca3af;
}

body.dark-mode .mode-option.active {
  background-color: #1f2937;
  color: #60a5fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Dark mode styles for quizlet sub options */
body.dark-mode .quizlet-sub-options label {
  color: #d1d5db;
}

/* Dark mode styles for order options */
body.dark-mode .order-options label {
  color: #d1d5db;
}

/* Mobile responsiveness for import button */
@media (max-width: 768px) {
  .import-button {
    margin-left: 0;
    margin-top: 0.5rem;
    width: auto;
  }
} 