/* Text Learn Frontend Styles */



.text-learn-wrapper {

  box-sizing: border-box;

  margin: 0;

  padding: 0;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  min-height: 100vh;

  padding: 20px 0;

}



.text-learn-wrapper * {

  box-sizing: border-box;

}



.text-learn-wrapper .container {

  max-width: 1000px;

  margin: 0 auto;

  padding: 24px;

}



.text-learn-wrapper .header {

  text-align: center;

  margin-bottom: 32px;

  color: white;

}



.text-learn-wrapper .title {

  font-size: 32px;

  font-weight: 700;

  margin: 0 0 8px 0;

  text-shadow: 0 2px 4px rgba(0,0,0,0.3);

}



.text-learn-wrapper .subtitle {

  font-size: 16px;

  opacity: 0.9;

  margin-bottom: 24px;

}



.text-learn-wrapper .controls-bar {

  display: flex;

  justify-content: space-between;

  align-items: center;

  background: rgba(255,255,255,0.95);

  backdrop-filter: blur(10px);

  border-radius: 16px;

  padding: 16px 24px;

  margin-bottom: 24px;

  box-shadow: 0 8px 32px rgba(0,0,0,0.1);

}



.text-learn-wrapper .language-selector {

  display: flex;

  gap: 8px;

  background: rgba(255,255,255,0.8);

  padding: 4px;

  border-radius: 12px;

  flex-wrap: wrap;

}



.text-learn-wrapper .lang-btn {

  padding: 8px 12px;

  border: none;

  background: transparent;

  color: #666;

  font-size: 13px;

  font-weight: 600;

  border-radius: 8px;

  cursor: pointer;

  transition: all 0.3s ease;

  display: flex;

  align-items: center;

  gap: 4px;

}



.text-learn-wrapper .lang-btn:hover {

  background: rgba(102, 126, 234, 0.1);

  transform: translateY(-1px);

}



.text-learn-wrapper .lang-btn.active {

  background: linear-gradient(135deg, #667eea, #764ba2);

  color: white;

  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);

}



.text-learn-wrapper .difficulty-indicator {

  display: flex;

  align-items: center;

  gap: 8px;

  font-size: 14px;

  color: #666;

}



.text-learn-wrapper .difficulty-stars {

  display: flex;

  gap: 2px;

}



.text-learn-wrapper .star {

  width: 16px;

  height: 16px;

  color: #fbbf24;

}



.text-learn-wrapper .progress-bar {

  flex: 1;

  max-width: 200px;

  margin: 0 24px;

}



.text-learn-wrapper .progress-label {

  font-size: 12px;

  color: #666;

  margin-bottom: 4px;

}



.text-learn-wrapper .progress-track {

  height: 6px;

  background: rgba(0,0,0,0.1);

  border-radius: 3px;

  overflow: hidden;

}



.text-learn-wrapper .progress-fill {

  height: 100%;

  background: linear-gradient(90deg, #667eea, #764ba2);

  border-radius: 3px;

  transition: width 0.5s ease;

  width: 0%;

}



.text-learn-wrapper .main-layout {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 24px;

  margin-bottom: 24px;

}



.text-learn-wrapper .text-panel {

  background: rgba(255,255,255,0.95);

  backdrop-filter: blur(10px);

  border-radius: 20px;

  padding: 32px;

  box-shadow: 0 8px 32px rgba(0,0,0,0.1);

  border: 1px solid rgba(255,255,255,0.2);

}



.text-learn-wrapper .panel-header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 20px;

}



.text-learn-wrapper .panel-title {

  font-size: 18px;

  font-weight: 600;

  color: #1a1a1a;

  display: flex;

  align-items: center;

  gap: 8px;

}



.text-learn-wrapper .panel-icon {

  width: 20px;

  height: 20px;

}



.text-learn-wrapper .word-count {

  font-size: 12px;

  color: #666;

  background: rgba(102, 126, 234, 0.1);

  padding: 4px 8px;

  border-radius: 6px;

}



.text-learn-wrapper .main-text {

  font-size: 18px;

  line-height: 1.8;

  color: #1a1a1a;

  margin-bottom: 20px;

  cursor: text;

}






.text-learn-wrapper .selectable-word {

  cursor: default; /* ðŸ†• Normalan kursor */

  padding: 1px 2px;

  border-radius: 3px;

  transition: all 0.2s;

  user-select: none;

}



.text-learn-wrapper .selectable-word:hover {

  background: rgba(102, 126, 234, 0.12); /* ðŸ†• Blaga pozadina samo na hover */

  cursor: pointer; /* ðŸ†• Pointer SAMO na hover */

}



/* Vocabulary words have slightly stronger hover effect */

.text-learn-wrapper .selectable-word[data-vocab="true"]:hover {

  background: rgba(102, 126, 234, 0.18);

  box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);

}



.text-learn-wrapper .selected-word {

  background: rgba(34, 197, 94, 0.2);

  border: 1px solid rgba(34, 197, 94, 0.4);

  font-weight: 600;

}



.text-learn-wrapper .selected-word:hover {

  background: rgba(34, 197, 94, 0.3);

}



.text-learn-wrapper .audio-controls {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 16px;

  background: rgba(102, 126, 234, 0.05);

  border-radius: 12px;

  border: 1px solid rgba(102, 126, 234, 0.1);

}



.text-learn-wrapper .play-btn {

  width: 44px;

  height: 44px;

  border: none;

  background: linear-gradient(135deg, #667eea, #764ba2);

  color: white;

  border-radius: 50%;

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 16px;

  transition: all 0.3s ease;

  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);

}



.text-learn-wrapper .play-btn:hover {

  transform: scale(1.05);

  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);

}



.text-learn-wrapper .audio-info {

  flex: 1;

}



.text-learn-wrapper .audio-title {

  font-size: 14px;

  font-weight: 500;

  color: #333;

  margin-bottom: 2px;

}



.text-learn-wrapper .audio-subtitle {

  font-size: 12px;

  color: #666;

}



.text-learn-wrapper .speed-control {

  display: flex;

  align-items: center;

  gap: 8px;

  font-size: 12px;

  color: #666;

}



.text-learn-wrapper .speed-btn {

  padding: 4px 8px;

  border: 1px solid rgba(102, 126, 234, 0.3);

  background: white;

  color: #667eea;

  border-radius: 4px;

  cursor: pointer;

  font-size: 11px;

  transition: all 0.2s;

}



.text-learn-wrapper .speed-btn:hover {

  background: rgba(102, 126, 234, 0.1);

}



.text-learn-wrapper .speed-btn.active {

  background: #667eea;

  color: white;

}



.text-learn-wrapper .translation-text {

  font-size: 16px;

  line-height: 1.7;

  color: #333;

}



.text-learn-wrapper .bottom-panels {

  display: grid;

  grid-template-columns: 2fr 1fr;

  gap: 24px;

}

@media (max-width: 768px) {

  .text-learn-wrapper .bottom-panels {

    grid-template-columns: 1fr; /* Na mobilnom stack vertikalno */

  }

}



.text-learn-wrapper .explanations-panel {

  background: rgba(255,255,255,0.95);

  backdrop-filter: blur(10px);

  border-radius: 20px;

  padding: 32px;

  box-shadow: 0 8px 32px rgba(0,0,0,0.1);

  border: 1px solid rgba(255,255,255,0.2);

}



.text-learn-wrapper .vocabulary-panel {

  background: rgba(255,255,255,0.95);

  backdrop-filter: blur(10px);

  border-radius: 20px;

  padding: 32px;

  box-shadow: 0 8px 32px rgba(0,0,0,0.1);

  border: 1px solid rgba(255,255,255,0.2);

  min-width: 280px; /* 🆕 Minimalna širina */

}



.text-learn-wrapper .explanation-item {

  padding: 20px;

  background: rgba(102, 126, 234, 0.05);

  border-radius: 12px;

  margin-bottom: 16px;

  border-left: 4px solid #667eea;

}



.text-learn-wrapper .explanation-item:last-child {

  margin-bottom: 0;

}



.text-learn-wrapper .explanation-title {

  font-size: 14px;

  font-weight: 600;

  color: #667eea;

  margin-bottom: 8px;

  display: flex;

  align-items: center;

  gap: 6px;

}



.text-learn-wrapper .explanation-content {

  font-size: 14px;

  line-height: 1.6;

  color: #555;

}



.text-learn-wrapper .vocab-item {

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 12px 16px;

  background: rgba(102, 126, 234, 0.05);

  border-radius: 8px;

  margin-bottom: 8px;

  cursor: pointer;

  transition: all 0.2s;

  gap: 12px; /* 🆕 Razmak između elemenata */

}



.text-learn-wrapper .vocab-item:hover {

  background: rgba(102, 126, 234, 0.1);

  transform: translateX(4px);

}

.text-learn-wrapper .vocab-word {

  font-weight: 600;

  color: #333;

  white-space: nowrap; /* 🆕 Sprečavaломljenje reči */

  overflow: hidden;

  text-overflow: ellipsis;

  flex-shrink: 0; /* 🆕 Ne sme se smanjivati */

}



.text-learn-wrapper .vocab-translation {

  font-size: 13px;

  color: #666;

  white-space: nowrap; /* 🆕 Sprečava lomljenje */

  overflow: hidden;

  text-overflow: ellipsis;

  flex: 1; /* 🆕 Zauzima preostali prostor */

  text-align: right; /* 🆕 Poravnanje desno */

}



.text-learn-wrapper .floating-tooltip {

  position: fixed;

  background: rgba(0,0,0,0.9);

  color: white;

  padding: 8px 12px;

  border-radius: 6px;

  font-size: 12px;

  pointer-events: none;

  z-index: 1000;

  opacity: 0;

  transition: opacity 0.2s;

}

/* ========================================
   SIDEBAR LESSON LIST WIDGET
   ======================================== */

.text-learn-sidebar-widget {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Filters */
.sidebar-filters {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.sidebar-filter-row {
  margin-bottom: 8px;
}

.sidebar-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-select:hover {
  border-color: #667eea;
}

.sidebar-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sidebar-filter-btn {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 6px;
}

.sidebar-filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sidebar-clear-btn {
  display: block;
  width: 100%;
  padding: 6px 12px;
  text-align: center;
  background: #f0f0f0;
  color: #666;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-clear-btn:hover {
  background: #e0e0e0;
  color: #333;
}

/* Lessons List */
.text-learn-sidebar-list {
  /* Container styles */
}

.sidebar-lesson-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-lesson-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-lesson-link {
  display: block;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-lesson-link:hover {
  transform: translateX(4px);
}

/* NEW LAYOUT: Badge → Title → Theme */
.sidebar-lesson-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

.sidebar-lesson-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  margin: 0;
}

.sidebar-lesson-link:hover .sidebar-lesson-title {
  color: #667eea;
}

.sidebar-theme {
  font-size: 10px;
  color: #bbb;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0;
  padding: 0;
  background: none !important;
  border-radius: 0;
  max-width: none;
}

.sidebar-lesson-link:hover .sidebar-lesson-title {
  color: #667eea;
}

.sidebar-lesson-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Language Level Badges */
.sidebar-level-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-level-badge.level-1 {
  background: #dcfce7;
  color: #166534;
}

.sidebar-level-badge.level-2 {
  background: #dbeafe;
  color: #1e40af;
}

.sidebar-level-badge.level-3 {
  background: #fef3c7;
  color: #92400e;
}

.sidebar-level-badge.level-4 {
  background: #fed7aa;
  color: #9a3412;
}

.sidebar-level-badge.level-5 {
  background: #fecaca;
  color: #991b1b;
}

.sidebar-theme {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* Pagination */
.sidebar-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.sidebar-page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #333;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s;
}

.sidebar-page-btn:hover {
  background: #667eea;
  color: white;
  transform: scale(1.1);
}

.sidebar-page-info {
  font-size: 13px;
  color: #666;
  font-weight: 600;
  padding: 0 8px;
}

.text-learn-sidebar-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .text-learn-sidebar-widget {
    padding: 12px;
  }
  
  .sidebar-lesson-title {
    font-size: 13px;
  }
  
  .sidebar-theme {
    max-width: 80px;
  }
}



/* Responsive Design */

@media (max-width: 768px) {

  .text-learn-wrapper .main-layout,

  .text-learn-wrapper .bottom-panels {

    grid-template-columns: 1fr;

  }

  

  .text-learn-wrapper .controls-bar {

    flex-direction: column;

    gap: 16px;

  }

  

  .text-learn-wrapper .progress-bar {

    max-width: none;

    margin: 0;

    width: 100%;

  }

  

  .text-learn-wrapper .language-selector {

    width: 100%;

    justify-content: center;

  }

  

  .text-learn-wrapper .container {

    padding: 16px;

  }

  

  .text-learn-wrapper .text-panel,

  .text-learn-wrapper .explanations-panel,

  .text-learn-wrapper .vocabulary-panel {

    padding: 20px;

  }

}



@media (max-width: 1200px) {

  .text-learn-wrapper .bottom-panels {

    grid-template-columns: 1.5fr 1fr; /* Malo uži Explanations panel */

  }

}



@media (max-width: 968px) {

  .text-learn-wrapper .bottom-panels {

    grid-template-columns: 1fr; /* Stack vertikalno */

  }

  

  .text-learn-wrapper .vocabulary-panel {

    min-width: unset; /* Ukloni min-width na mobilnom */

  }

}