/**
 * Learn Mode Specific Styles
 * Phase 3 - Practice mode flashcards, controls, and navigation
 */

/* Learn Mode Container - CSS Grid for sidebar spanning full height */
#learn-mode-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--dark-blue);
}

/* Learn Header Bar - spans full width at top */
.learn-header-bar {
  grid-column: 1 / -1;
  grid-row: 1;
}

/* Learn Sidebar - spans rows 2-3 for full height */
.learn-sidebar {
  grid-column: 1;
  grid-row: 2 / -1;
  background: var(--header-blue);
  padding: 0;
  margin: 10px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100% - 20px);
}

/* Upper Row - content area only */
.learn-upper-row {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Header-blue strip on left edge to match sidebar */
.learn-upper-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 10px;
  background: var(--header-blue);
  z-index: 1;
}

/* Learn Toolbar Area - only in column 2, next to sidebar */
.learn-toolbar-area {
  grid-column: 2;
  grid-row: 3;
  background: var(--dark-blue);
  flex-shrink: 0;
  margin-left: 10px;
}

/* When sidebar is hidden, adjust grid */
#learn-mode-container:has(.learn-sidebar.sidebar-hidden) {
  grid-template-columns: 1fr;
}

#learn-mode-container:has(.learn-sidebar.sidebar-hidden) .learn-upper-row {
  grid-column: 1;
}

#learn-mode-container:has(.learn-sidebar.sidebar-hidden) .learn-toolbar-area {
  padding-left: 0;
}

/* Hide sidebar in Complete Aliya mode */
.learn-sidebar.sidebar-hidden {
  display: none;
}

/* Learn Mode Tabs */
.learn-tabs {
  display: flex;
  gap: 4px;
}

.learn-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
}

.learn-tab:hover {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

.learn-tab.active {
  background: white;
  color: #2e3b68;
  font-weight: 600;
}

/* Tab Content */
.learn-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  min-height: 0;
}

.tab-pane {
  display: none;
  flex: 1;
  box-sizing: border-box;
  padding: 10px;
  min-height: 0;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* Complete Aliya Tab - Column Thumbnail Navigation */
#complete-aliya-content {
  padding: 0; /* Remove padding for thumbnail nav to use full space */
}

#complete-aliya-content column-thumbnail-nav {
  flex: 1;
  min-height: 0;
}

.learn-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.learn-controls h3 {
  margin: 0 0 15px 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 10px;
}

/* Control Groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.learn-select {
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.learn-select:hover {
  border-color: #4a5680;
}

.learn-select:focus {
  outline: none;
  border-color: #4a5680;
  box-shadow: 0 0 0 3px var(--header-blue-10);
}

/* LearnButtons */
.learn-btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.learn-btn.primary:hover:not(:disabled) {
  background-color: #3c4a6b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--header-blue-30);
}

.learn-btn.secondary {
  background-color: white;
  color: #4a5680;
  border: 1px solid #4a5680;
}

.learn-btn.secondary:hover:not(:disabled) {
  background-color: #4a5680;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--header-blue-30);
}

.learn-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Context Display */
#learn-context-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.context-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-label {
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.context-value {
  font-size: 18px;
  color: #2e3b68;
  font-weight: 600;
}

.context-kriyah {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* Verse Only Toggle */
.vowel-toggle-section {
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vowel-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.vowel-toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.vowel-toggle-label span {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* LearnStats */
.learn-stats {
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

/* Learn Main Wrapper - contains header, content row, and toolbar */
.learn-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Learn Content Row - contains main content and TalkJS panel side by side */
.learn-content-row {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* LearnContent Area */
.learn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* Learn Header Bar (similar to manage-toolbar) */
.learn-header-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0px 16px 4px 16px;
  background: var(--header-blue);
  flex-shrink: 0;
  min-height: var(--header-bar-height);
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}

/* Left side of header bar (tabs) - centered above sidebar */
.learn-header-left {
  width: var(--sidebar-width);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Tabs in header bar */
.learn-header-bar .learn-tabs {
  padding: 0;
  background: transparent;
}

.learn-header-center {
  position: absolute;
  left: calc(var(--sidebar-width) + (100% - var(--sidebar-width)) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.learn-collaborator-section {
  position: absolute;
  left: calc(0.25 * var(--sidebar-width) + 75%);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Learn Bookmark Indicator */
.learn-bookmark-indicator {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.4);
}

.learn-bookmark-indicator svg {
  width: 100%;
  height: 100%;
}

.learn-bookmark-indicator:hover {
  color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

/* Owner state - solid white */
.learn-bookmark-indicator.owner {
  color: white;
}

.learn-bookmark-indicator.owner:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Collaborator state - lighter blue */
.learn-bookmark-indicator.collaborator {
  color: var(--sidebar-accent-blue);
}

.learn-bookmark-indicator.collaborator:hover {
  color: var(--focus-blue);
}

/* Collaborator text display */
.learn-collaborator-text {
  color: white;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.learn-collaborator-text:empty {
  display: none;
}

/* "Learn with..." button */
.learn-with-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.learn-with-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Invite Collaborator Inline Form */
.invite-collaborator-form {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-collaborator-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invite-collaborator-select {
  flex: 0 0 200px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.invite-collaborator-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
}

.invite-collaborator-message {
  flex: 1;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  resize: none;
}

.invite-collaborator-message:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
}

.invite-collaborator-btn-send {
  padding: 8px 16px;
  background: #27ae60;
  border: none;
  color: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.invite-collaborator-btn-send:hover {
  background: #219a52;
}

.invite-collaborator-btn-send:disabled {
  background: #666;
  cursor: not-allowed;
}

.invite-collaborator-btn-cancel {
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.invite-collaborator-btn-cancel:hover {
  color: white;
}

.invite-collaborator-status {
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.invite-collaborator-status.error {
  background: rgba(192, 57, 43, 0.2);
  color: #ff8080;
}

.invite-collaborator-status.success {
  background: rgba(39, 174, 96, 0.2);
  color: #80ff80;
}

/* Responsive: stack on narrow screens */
@media (max-width: 600px) {
  .invite-collaborator-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .invite-collaborator-select {
    flex: none;
    width: 100%;
  }

  .invite-collaborator-message {
    width: 100%;
  }

  .invite-collaborator-btn-send,
  .invite-collaborator-btn-cancel {
    align-self: flex-end;
  }
}

/* LearnNavigation Bar */
.learn-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  gap: 20px;
  flex-shrink: 0;
}

.learn-nav-info {
  flex: 1;
  text-align: center;
}

.verse-display {
  font-size: 18px;
  font-weight: 600;
  color: #4a5680;
}

/* Flashcard Area */
.learn-flashcard-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--dark-blue);
  overflow: visible;
  gap: 10px;
  position: relative;
  container-type: inline-size;
  container-name: flashcard-area;
}

.flashcard-with-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Vertical navigation wrapper for flashcard */
.flashcard-with-vertical-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Vertical arrow buttons - rotate the horizontal arrow images */
.learn-flashcard-area .nav-arrow-up,
.learn-flashcard-area .nav-arrow-down {
  width: 40px !important;
  height: 40px !important;
}

.learn-flashcard-area .nav-arrow-up img {
  transform: rotate(90deg) !important;
}

.learn-flashcard-area .nav-arrow-down img {
  transform: rotate(-90deg) !important;
}

.flashcard-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verse-indicator {
  position: absolute;
  top: -25px;
  right: -25px;
  background: var(--focus-blue-90);
  color: white;
  font-size: 24px;
  font-weight: 600;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: opacity 0.2s ease;
}

.verse-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.complete-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(200, 200, 200, 0.5);
  color: rgba(100, 100, 100, 0.7);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border: 1.5px solid rgba(150, 150, 150, 0.6);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.complete-toggle:hover {
  background: rgba(180, 180, 180, 0.6);
  color: rgba(80, 80, 80, 0.9);
  border-color: rgba(130, 130, 130, 0.7);
  transform: scale(1.05);
}

.complete-toggle.active {
  background: rgba(46, 204, 113, 0.9);
  color: white;
  border-color: rgba(46, 204, 113, 1);
}

.complete-toggle.active:hover {
  background: rgba(46, 204, 113, 1);
  border-color: rgba(39, 174, 96, 1);
}

.complete-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

.learn-flashcard-area .nav-arrow {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 8px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
  width: 53px !important;
  height: 53px !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex-shrink: 0 !important;
}

.learn-flashcard-area .nav-arrow img {
  width: 40px !important;
  height: 40px !important;
  display: block !important;
  filter: brightness(0) invert(1) !important;
  opacity: 0.8 !important;
  transition: all 0.2s ease !important;
  visibility: visible !important;
}

.learn-flashcard-area .nav-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.learn-flashcard-area .nav-arrow:hover:not(:disabled) img {
  opacity: 1;
  transform: scale(1.15);
}

.learn-flashcard-area .nav-arrow:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.learn-flashcard-area .nav-arrow:disabled img {
  opacity: 0.3 !important;
}

flashcard-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  max-width: 800px;
}

/* Complete Aliya Display Area */
.complete-aliya-display-area {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--dark-blue);
  overflow: hidden;
  gap: 10px;
  position: relative;
}

/* Scrollable container for Complete Aliya content */
.complete-aliya-scroll-container {
  flex: 1;
  overflow: auto;
  min-width: 0;
  height: 100%;
  display: flex;
  justify-content: center;
}

/* Complete Aliya columns - prevent flex shrinking in both-mode */
#complete-aliya-text-display {
  flex-shrink: 0; /* Prevent shrinking */
}

#complete-aliya-columns-flex-row.both-mode {
  justify-content: flex-start;
  flex-shrink: 0; /* Prevent shrinking */
}

/* Center content when displaying a single column (torah-only or tikkun-only) */
#complete-aliya-columns-flex-row:not(.both-mode) {
  justify-content: center;
}

/* Complete Aliya containers use same flex behavior as Browse mode */
#complete-aliya-columns-flex-row.both-mode .column-content-container {
  /* Inherit flex: 1 1 0 from base .column-content-container to allow shrinking like Browse mode */
}

/* Container query setup is handled by tikkun-zoom-container component */

.complete-aliya-display-area .nav-arrow {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 12px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
  flex-shrink: 0 !important;
}

.complete-aliya-display-area .nav-arrow img {
  width: 60px;
  height: 60px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.complete-aliya-display-area .nav-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05) !important;
}

.complete-aliya-display-area .nav-arrow:hover:not(:disabled) img {
  opacity: 1;
}

.complete-aliya-display-area .nav-arrow:disabled {
  cursor: not-allowed !important;
  opacity: 0.4 !important;
}

.complete-aliya-display-area .nav-arrow:disabled img {
  opacity: 0.3;
}

/* Coming Soon Area (main content) */
.learn-coming-soon-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--dark-blue);
  overflow: auto;
}

.main-coming-soon-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 60px 80px;
}

.main-coming-soon-message h2 {
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 15px 0;
}

.main-coming-soon-message p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  margin: 0;
  font-style: italic;
}

/* LearnContent Area Background (removed - toolbar provides its own background) */
/* .learn-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--dark-blue);
  z-index: 0;
} */

/* LearnToolbar */
.learn-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--toolbar-height);
  padding: 0 20px;
  background: var(--header-blue);
  border-top: none;
  gap: 20px;
  flex-wrap: wrap;
  margin: var(--toolbar-margin);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Complete Aliya view toggle - position on left */
#complete-aliya-view-toggle {
  position: absolute;
  left: 10px;
}

/* Progress Bar in Toolbar - shown when aliyah is bookmarked */
.learn-toolbar aliyah-progress-bar {
  position: absolute;
  right: 20px;
}

/* View Mode Toggle - left side */
.view-mode-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Complete Aliya Action Buttons - Record, Play, Note */
.complete-aliya-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 16px;
}

.aliya-action-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.aliya-action-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
  opacity: 0.9;
  transition: opacity 0.2s;
}

/* Phrase colors spectrum icon - bigger, no padding */
#complete-aliya-phrase-colors-btn,
#flashcard-phrase-colors-btn {
  padding: 3px;
  background: transparent;
  border-radius: 4px;
}

#complete-aliya-phrase-colors-btn svg,
#flashcard-phrase-colors-btn svg {
  width: 32px;
  height: 18px;
  fill: none;
}

#complete-aliya-phrase-colors-btn img,
#flashcard-phrase-colors-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  transition: opacity 0.2s;
  background: transparent;
  display: block;
}

#complete-aliya-phrase-colors-btn:hover img,
#flashcard-phrase-colors-btn:hover img {
  opacity: 1;
}

#complete-aliya-phrase-colors-btn:hover,
#flashcard-phrase-colors-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#complete-aliya-phrase-colors-btn.active,
#flashcard-phrase-colors-btn.active {
  background: white;
}

.aliya-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.aliya-action-btn:hover svg {
  opacity: 1;
}

.aliya-action-btn.active {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.aliya-action-btn.active svg {
  opacity: 1;
}

/* LearnActions - right side */
.learn-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-mode-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 60px;
}

.view-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

.view-mode-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Navigation Arrows (shared with Browse) */
.learn-nav-bar .nav-arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learn-nav-bar .nav-arrow img {
  width: 24px;
  height: 24px;
  display: block;
}

.learn-nav-bar .nav-arrow:hover:not(:disabled) {
  background: var(--header-blue-10);
  transform: scale(1.1);
}

.learn-nav-bar .nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .learn-sidebar {
    padding: 15px;
  }

  .learn-controls h3 {
    font-size: 16px;
  }

  .learn-nav-bar {
    padding: 10px 15px;
  }

  .verse-display {
    font-size: 16px;
  }

  .learn-flashcard-area {
    padding: 15px;
  }

  flashcard-viewer {
    min-height: 350px;
  }

  .learn-toolbar {
    padding: 12px 15px;
    gap: 10px;
  }

  .learn-action-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .learn-controls {
    gap: 15px;
  }

  .learn-select {
    font-size: 14px;
  }

  .learn-btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .learn-flashcard-area {
    padding: 10px;
  }

  flashcard-viewer {
    min-height: 300px;
  }

  .learn-toolbar {
    flex-wrap: wrap;
  }
}

/* Grid View Styles */
.learn-grid-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: var(--dark-blue);
  overflow-y: auto;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
  gap: 20px;
  width: 100%;
  max-width: 1800px;
  justify-content: center;
  padding: 10px;
  direction: rtl;
}

.grid-card {
  position: relative;
  width: 300px;
  height: 150px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  overflow: visible;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Current card indicator */
.grid-card.current {
  outline: 3px solid #4a69bd;
  outline-offset: 4px;
  box-shadow: 0 2px 8px var(--focus-blue-30);
}

.grid-card.current:hover {
  outline: 3px solid #4a69bd;
  outline-offset: 4px;
}

.grid-card flashcard-viewer {
  pointer-events: none;
  width: 300px;
  height: 150px;
  --flashcard-width: 300px;
  --flashcard-min-width: 300px;
  --flashcard-height: 150px;
  --flashcard-border: 2px solid #A9B7E5;
  --flashcard-border-radius: 8px;
  --hebrew-font-size: 14px;
  --hebrew-line-height: 1.2em;
  font-size: 14px;
}

/* Grid card verse number overlay */
.grid-card-number {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--focus-blue-90);
  color: white;
  font-size: 12px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Completed flashcard styling */
.grid-card.complete {
  border: 2px solid #4caf50;
  background: #f1f8f4;
}

.grid-card.complete .grid-card-number {
  background: #4caf50;
}

.grid-card.complete::after {
  content: '✓';
  position: absolute;
  top: 4px;
  left: 4px;
  background: #4caf50;
  color: white;
  font-size: 14px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}

/* =====================================================
   TalkJS Chat Panel Styles
   ===================================================== */

.talkjs-right-panel {
  width: 380px;
  height: 100%;
  background: #f5f5f5;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.talkjs-right-panel.hidden {
  display: none;
}

.talkjs-right-panel.active {
  display: flex;
}

.talkjs-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: white;
  position: relative;
}

/* TalkJS Chat Web Component */
talkjs-chat,
#talkjs-chat-component {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.talkjs-chat-container {
  width: 100%;
  height: 100%;
}

/* Classic SDK uses iframe - ensure it fills container */
.talkjs-chat-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

.talkjs-no-match-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  margin: 20px;
  border-radius: 8px;
  font-size: 16px;
  height: calc(100% - 40px);
  box-sizing: border-box;
}

/* Bookmark prompt - clickable to create bookmark */
.talkjs-bookmark-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  margin: 20px;
  border-radius: 8px;
  height: calc(100% - 40px);
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
}

.talkjs-bookmark-prompt:hover {
  background: #ffe69c;
  border-color: #e0a800;
}

.talkjs-bookmark-icon {
  width: 48px;
  height: 48px;
  color: #856404;
  transition: transform 0.2s ease;
}

.talkjs-bookmark-icon svg {
  width: 100%;
  height: 100%;
}

.talkjs-bookmark-prompt:hover .talkjs-bookmark-icon {
  transform: scale(1.1);
}

.talkjs-bookmark-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.talkjs-loading {
  color: #666;
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.talkjs-error {
  color: #d32f2f;
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Chat Panel Toggle Button */
.chat-toggle-btn {
  position: absolute;
  left: -14px;
  top: 100px;
  width: 28px;
  height: 56px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease;
}

.chat-toggle-btn:hover {
  background: #f0f0f0;
}

.chat-toggle-btn img {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

/* Arrow points left when expanded (to collapse), right when collapsed (to expand) */
.talkjs-right-panel:not(.collapsed) .chat-toggle-btn img {
  transform: rotate(180deg);
}

/* Panel positioning and transition */
.talkjs-right-panel {
  position: relative;
  transition: width 0.3s ease;
}

/* Collapsed state - keep 28px for toggle button */
.talkjs-right-panel.collapsed {
  width: 28px;
  border-left: none;
  background: transparent;
}

.talkjs-right-panel.collapsed .talkjs-content {
  display: none;
}

/* Adjust toggle button position when collapsed */
.talkjs-right-panel.collapsed .chat-toggle-btn {
  left: 0;
}

/* Note: Chat header visibility is controlled via showChatHeader option in classic SDK */

/* =====================================================
   Chat Panel Header with Zoom Button
   ===================================================== */

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.chat-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =====================================================
   Zoom Meeting Button Styles
   ===================================================== */

.zoom-meeting-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #2d8cff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zoom-start-btn:hover:not(:disabled) {
  background: #1a73e8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(45, 140, 255, 0.3);
}

.zoom-start-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.zoom-start-btn.loading {
  background: #666;
}

.zoom-start-btn.active {
  background: #27ae60;
}

.zoom-icon {
  width: 16px;
  height: 16px;
}

.zoom-btn-text {
  white-space: nowrap;
}

/* Meeting info panel */
.zoom-meeting-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-meeting-info.hidden {
  display: none;
}

.zoom-meeting-actions {
  display: flex;
  gap: 4px;
}

.zoom-join-btn {
  padding: 4px 10px;
  background: #27ae60;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  transition: background 0.2s;
}

.zoom-join-btn:hover {
  background: #219150;
}

.zoom-copy-btn,
.zoom-share-btn,
.zoom-cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-copy-btn:hover,
.zoom-share-btn:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.zoom-cancel-btn:hover {
  background: #fee;
  border-color: #e74c3c;
}

.zoom-cancel-btn:hover svg {
  stroke: #e74c3c;
}

.zoom-copy-btn svg,
.zoom-share-btn svg,
.zoom-cancel-btn svg {
  width: 14px;
  height: 14px;
  stroke: #555;
}

/* Toast notification */
.zoom-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.zoom-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Hide header when collapsed */
.talkjs-right-panel.collapsed .chat-panel-header {
  display: none;
}

/* =====================================================
   Share Position Button Styles
   ===================================================== */

.share-position-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #6c5ce7;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-position-btn:hover {
  background: #5b4cdb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.share-position-icon {
  width: 14px;
  height: 14px;
}

.share-position-text {
  white-space: nowrap;
}
