/* ========================================
   FlashCards - 3-колонная адаптивная верстка
   ======================================== */

/* Глобальные стили */
* { 
    box-sizing: border-box; 
}

/** {
    font-family: 'Saira Extra Condensed', sans-serif !important;
}

body {
    font-family: "Saira Extra Condensed", -apple-system, BlinkMacSystemFont, 
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, 
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", 
                 "Noto Color Emoji";
    text-transform: uppercase;
}*/

body, html, * {
    font-family: "Exo 2", "Rajdhani", "Orbitron", "PT Serif", "Inter", sans-serif !important;

    font-weight: 500 !important;;

    text-transform: uppercase;
}

.btn, .btn *, .btn-brick, .btn-brick * {
    text-transform: uppercase !important;
}

/* ФИКС: кириллица не растягивает блоки 
:lang(ru), :lang(pt) {
  letter-spacing: -0.02em;     
  word-spacing: -0.5px;        
  text-rendering: optimizeLegibility;
}*/

html:lang(ru) { font-size: 85%; }

html {
    font-size: 85%;
}    

:lang(ru) {
    /* 🔥 ПОХОЖИЕ НА SAIRA - узкие кириллические */
    font-family: "Exo 2", "Rajdhani", "Orbitron", "PT Serif", "Inter", sans-serif !important;
    letter-spacing: -0.05em;
}

/*nav .nav-link:lang(ru) {
    font-size: 11pt !important;  
}*/

/* ФИКС: блоки не расширяются */
.resume-section, .card, .card-body {
  min-height: 120px;  
}

/* Типографика */
/*h1, .h1 { font-size: calc(1.725rem + 2.7vw); }*/
p.lead { font-size: 1rem; font-weight: 400; }
label { font-size: 0.7rem; }
textarea { text-transform: uppercase; }
input { text-transform: uppercase; }
select { text-transform: uppercase; }

/* Цветовая схема */
.btn-brick {
    background-color: #bd5d38 !important;
    color: rgba(255,255,255,0.95) !important;
}

.text-brick { color: #bd5d38 !important; }
.text-brick:hover { color: #a54a2e !important; }

/* Формы и инпуты */
.form-control:focus {
    border-color: #deae9c;
    box-shadow: 0 0 0 0.25rem rgba(189, 93, 56, 0.25);
}

/* Убираем скругления */
.form-control, .form-control-lg, .btn, .btn-lg, .card, .alert {
    border-radius: 5px !important;
}

.login-form {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* ========================================
   ЛЕВАЯ НАВИГАЦИЯ (десктоп)
   ======================================== */
#leftSidebarDesktop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 20rem !important;
    height: 100vh !important;
    z-index: 1050 !important;
    background-color: #bd5d38 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto;
    box-shadow: 3px 0 20px rgba(189,93,56,0.4);
}

#leftSidebarDesktop .nav-link {
    color: rgba(255,255,255,0.95) !important;
    background: transparent !important;
    padding: 12px 16px;
    justify-content: center !important;
}

/*#leftSidebarDesktop .nav-link:hover,*/
#leftSidebarDesktop .nav-link.active {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 5px;
}

/* ========================================
   ПРАВАЯ ПАНЕЛЬ - УНИВЕРСАЛЬНАЯ
   ======================================== */
#rightSidebarDesktop.right-sidebar-universal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 25rem !important;
    height: 100vh !important;
    z-index: 1040 !important;
    border-left: 1px solid #dee2e6;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* ========================================
   MAIN (десктоп по умолчанию)
   ======================================== */
main {
    margin-left: 17rem !important;
    margin-right: 17rem !important;
    min-height: 100vh;
}

/* ========================================
   🔥 КНОПКА ПРАВОЙ ПАНЕЛИ - ФИНАЛЬНАЯ ЛОГИКА
   ======================================== */
.right-panel-toggle {
    display: block !important; /* ✅ ВИДНА ПО УМОЛЧАНИЮ */
    z-index: 1060 !important;
}

/* ========================================
   АДАПТИВНОСТЬ - НОВАЯ ЛОГИКА
   ======================================== */

/* ✅ МОБИЛЬНЫЕ <992px - ПОЛНАЯ ШИРИНА */
@media (max-width: 991.98px) {
    #leftSidebarDesktop, #rightSidebarDesktop.right-sidebar-universal { 
        display: none !important; 
    }
    
    main { 
        margin: 0 !important;
        /*padding-top: 80px !important; */
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
    }
    
    .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
    
    .row {
        /*margin: 0 !important;*/

    }

    .row>* {
        /*padding-right: 0 !important;*/
        /*padding-left: 0 !important;*/
    }
    
    /* ✅ КНОПКА ВИДНА НА МОБИЛЬНЫХ */
    .right-panel-toggle {
        display: block !important;
    }

    /*-----*/
    .study-page {
        all: unset !important;
        display: block !important;
        padding: 1rem !important;
        padding-top: 3rem !important;
        min-height: 1px !important;
    }
    
    .study-page .resume-section-content {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Контейнер карточки */
    #card-container {
        margin-bottom: 2rem !important;
    }
}

/* ✅ НОУТБУКИ 992-1399px */
@media (min-width: 992px) and (max-width: 1399.98px) {
    #rightSidebarDesktop.right-sidebar-universal {
        transform: translateX(100%) !important;
    }
    
    main {
        margin-right: 0 !important;
        margin-left: 17rem !important;
        width: calc(100% - 17rem) !important;
        max-width: calc(100% - 17rem) !important;
        overflow-x: hidden !important;
    }
    
    /* ✅ КНОПКА ВИДНА НА НОУТБУКАХ */
    .right-panel-toggle {
        display: block !important;
    }
}

/* ✅ ДЕСКТОП ≥1400px */
@media (min-width: 1400px) {
    #rightSidebarDesktop.right-sidebar-universal {
        transform: none !important;
        visibility: visible !important;
    }
    
    main { 
        margin-right: 17rem !important; 
        margin-left: 17rem !important;
    }
    
    /* ✅ КНОПКА СКРЫТА НА ДЕСКТОПЕ */
    .right-panel-toggle {
        display: none !important;
    }
}

@media (min-width: 992px) {
    main { padding-top: 0 !important; }
}

/* ========================================
   МОБИЛЬНЫЕ МЕНЮ (offcanvas)
   ======================================== */
.mobile-menu-white .offcanvas-body {
    color: white !important;
}

.mobile-menu-white .offcanvas-body .nav-link,
/*.mobile-menu-white .offcanvas-body a,*/
.mobile-menu-white .offcanvas-body .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
}

.mobile-menu-white .offcanvas-body .nav-link:hover,
.mobile-menu-white .offcanvas-body .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
}

.offcanvas-body {
    scrollbar-width: thin;
}

/* ========================================
   МЕНЮ - submenu-toggle (иконка+текст+стрелка)
   ======================================== */
.submenu-toggle { 
    display: flex !important; 
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    width: 100% !important;
}

.folder-icon {
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
}

.set-title {
    flex-grow: 1 !important;
    text-align: center !important;
    margin: 0 12px !important;
}

.submenu-arrow { 
    margin-left: auto !important;
    flex-shrink: 0 !important;
    font-size: 0.8em !important; 
    transition: transform 0.2s ease !important;
}

.navbar-nav .ps-4 { 
    border-left: 3px solid #bd5d38 !important; 
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ СЕКЦИИ
   ======================================== */
.resume-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0.8rem;
    scroll-snap-align: start;
}

.resume-section-content {
    max-width: 800px;
    width: 100%;
}

.text-muted {
  font-size: 12px !important;
}
/*.text-muted:lang(ru) {
  font-size: 10px !important;
}*/
.badge {
    border-radius: 5px !important;
}

@media (max-width: 1920px) and (max-height: 1080px) {

    #leftSidebarDesktop .nav-link {
        padding: 3px 16px;
    }
}

.lang-pills {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 0;
}

.lang-pill {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  /*background: rgba(255, 255, 255, 0.9);*/
  color: #FFF;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.lang-pill:hover { 
  transform: scale(1.1); 
  background: white;
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  color: #333;
}

.lang-pill.active { 
  background: #fff !important;
  color: #ff6b35 !important;      /* 🔥 ОРАНЖЕВЫЙ ТЕКСТ */
  border-color: #ff6b35 !important;
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
  font-weight: bold;
  font-size: 14px;
}

//-----

.card-item:hover {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  border-left: 4px solid #bd5d38 !important;
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
  transition: all 0.3s ease !important;
}

.card-item {
  border-left: 4px solid transparent !important;
}

.card_count {
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8f9fa;
}

.speak-btn {
  position: relative;
  width: 36px !important;
  height: 36px !important;
}

.speak-btn .bi-play {
  display: block !important;
  background-image: url('/assets/img/volume-up.svg') !important;
  background-size: cover !important;
  background-position: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
}

.speak-btn .bi-play.playing {
  background-image: url('/assets/img/volume-up-fill.svg') !important;
  animation: pulse 1s infinite !important;
  color: transparent !important;
}

.card-tag {
  font-size: 0.75rem;
}

.tag-chip:hover { opacity: 0.8; }
.tag-button:hover { 
  background: #bd5d38 !important; 
  color: white !important; 
  border-color: #bd5d38 !important;
}
#availableTags {
  min-height: 50px;
}
.voice-btn.recording {
  background-color: #dc3545 !important;
  color: white !important;
}

.tag-chip {
  **background: #e3f2fd !important;**     /* светло-голубой */
  **color: #1976d2 !important;**          /* тёмно-синий текст */
  **border: 1px solid #bbdefb !important;**  /* голубая рамка */
  **border-radius: 16px !important;**     /* округлые углы */
  font-weight: 500;
  background: #fce4d6 !important;
  color: #bd5d38 !important;
  border-radius: 5px !important;
  padding: 0.7rem;
  font-size: 0.9rem;
}

.tag-chip:hover {
  **background: #bbdefb !important;**     /* чуть темнее */
  color: #1565c0 !important;
  border-color: #90caf9 !important;
}

.tag-button:hover { 
  background: #bd5d38 !important; 
  color: white !important; 
  border-color: #bd5d38 !important;
}

.card-item:hover { 
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important; 
  border-left: 4px solid #bd5d38 !important;
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
  transition: all 0.3s ease !important;
}

.list-group-item {
  transition: all 0.3s ease !important;
  margin-bottom: 4px !important;
  border: none !important;
}

.card-item {
  border-left: 4px solid transparent !important;
}

.card_count { 
  cursor: pointer; 
  width: 36px; 
  height: 36px; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: 50%; 
  background: #f8f9fa;
}

.bi-play.playing {
  animation: spin 1s infinite linear;
  color: #28a745 !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.speak-btn {
  position: relative;
  width: 36px !important;
  height: 36px !important;
}

.speak-btn .bi-play {
  display: block !important;
  background-image: url('/assets/img/volume-up.svg') !important;
  background-size: cover !important;
  background-position: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
}

.speak-btn .bi-play.playing {
  background-image: url('/assets/img/volume-up-fill.svg') !important;
  animation: pulse 1s infinite !important;
  color: transparent !important; /* скрываем Bi icon */
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Убираем стандартный Bi icon */
.card_count .bi-play::before {
  content: none !important;
}

/* Полноэкранный режим обучения */
body.study-mode {
  overflow: hidden;
}

body.study-mode #leftSidebarDesktop,
body.study-mode #rightSidebarDesktop,
body.study-mode .navbar.d-lg-none,
body.study-mode .toggle-right-panel,
body.study-mode .offcanvas {
  display: none !important;
}

body.study-mode #content {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
  padding: 0 !important;
  margin: 0 !important;
}

body.study-mode #studyContainer {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Центрирование карточки */
body.study-mode .test {
  margin-left: auto;
  margin-right: auto;
}

/*--*/

.method-card.selected .method-card-inner {
  background: linear-gradient(135deg, #bd5d38 0%, #e27d5f 100%) !important;
  color: white !important;
}

.method-card.selected .text-dark,
.method-card.selected .text-muted,
.method-card.selected .text-brick,
.method-card.selected i {
  color: white !important;
}

.card {
  box-shadow: var(--bs-box-shadow) !important;
}

/*- tools -*/

.stacked-tools {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-card {
  border: none !important;
  /*border-radius: 16px !important;*/
  box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
  transition: all 0.3s ease !important;
  overflow: hidden;
  background: white !important;
}

.tool-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15) !important;
}

.tool-header {
  padding: 1.5rem 2rem !important;
  margin: 0 !important;
}

.tool-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-card .btn {
  font-weight: 600 !important;
  /*border-radius: 12px !important;*/
  padding: 12px 24px !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .tool-header {
    padding: 1.25rem 1.5rem !important;
  }
  
  .tool-icon {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
}

/*- sets -*/

.lang-badge {
  background: #bd5d38 !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 0.9em !important;
  padding: 10px 14px !important;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-outline-brick {
  border-color: #bd5d38 !important;
  color: #bd5d38 !important;
}

.btn-outline-brick:hover {
  background: #bd5d38 !important;
  color: white !important;
  border-color: #bd5d38 !important;
}

.set-item:hover { 
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important; 
  border-left: 4px solid #bd5d38 !important;
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
  transition: all 0.3s ease !important;
}

.question_list { 
  font-size: 1.1em; 
  color: #2c3e50; 
  margin-bottom: 4px;
  text-transform: uppercase !important;
}

.answer_list { 
  font-size: 0.95em; 
  opacity: 0.8; 
  color: #6c757d; 
}

.list-group-item {
  transition: all 0.3s ease !important;
  margin-bottom: 4px !important;
  border: none !important;
}

/*- cards -*/

.card-item:hover { 
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important; 
  border-left: 4px solid #bd5d38 !important;
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
  transition: all 0.3s ease !important;
}

.list-group-item {
  transition: all 0.3s ease !important;
  margin-bottom: 4px !important;
  border: none !important;
}

.card-item {
  border-left: 4px solid transparent !important;
}

.card_count { 
  cursor: pointer; 
  width: 36px; 
  height: 36px; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: 50%; 
  background: #f8f9fa;
}

.bi-play.playing {
  animation: spin 1s infinite linear;
  color: #28a745 !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.speak-btn {
  position: relative;
  width: 36px !important;
  height: 36px !important;
}

.speak-btn .bi-play {
  display: block !important;
  background-image: url('/assets/img/volume-up.svg') !important;
  background-size: cover !important;
  background-position: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
}

.speak-btn .bi-play.playing {
  background-image: url('/assets/img/volume-up-fill.svg') !important;
  animation: pulse 1s infinite !important;
  color: transparent !important; /* скрываем Bi icon */
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Убираем стандартный Bi icon */
.card_count .bi-play::before {
  content: none !important;
}

.navbar-nav {
    /*--bs-nav-link-padding-x: none !important;*/
}

.u-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* -- -- */

/* ========================================
   MATCHING GAME СТИЛИ
   ======================================== */

/* Контейнер */
.matching-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background: #f5f7fa;
}

/* Карточка */
.matching-card {
  width: 100%;
  margin: 0 auto;
}

/* Сетка вариантов — всегда одна колонка */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Кнопка варианта */
.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  font-family: inherit;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
}

.option-btn:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #bd5d38;
  transform: translateX(4px);
}

.option-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Буква варианта (A, B, C, D, E) */
.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 12px;
  background: #f0f0f0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #bd5d38;
  flex-shrink: 0;
}

/* Текст варианта */
.option-text {
  flex: 1;
}

/* Карточка с вопросом */
.card-body {
  padding: 1.5rem !important;
}

/* Текст вопроса */
#side-b-text {
  font-size: clamp(1.25rem, 6vw, 1.75rem);
  word-break: break-word;
  line-height: 1.3;
}

/* Прогресс бар */
.progress {
  height: 6px;
  border-radius: 10px;
  background: #e9ecef;
}

.progress-bar {
  border-radius: 10px;
}

/* Статус (#1/10) */
#status {
  font-size: 0.8rem;
}

/* Кнопка далее */
#next-btn {
  border-radius: 50px;
}

/* ========================================
   МОБИЛЬНАЯ ВЕРСИЯ (до 768px)
   ======================================== */
@media (max-width: 768px) {
  .matching-card {
    min-width: 350px;
  }

  .voice-container {
    min-width: 350px;
  }
  
  .option-btn {
    padding: 12px 14px;
    font-size: 14px;
  }
  
  .option-letter {
    width: 24px;
    height: 24px;
    font-size: 12px;
    margin-right: 10px;
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  .matching-container {
    padding: 12px;
  }
}

/* ========================================
   ДЕСКТОПНАЯ ВЕРСИЯ (от 768px)
   ======================================== */
@media (min-width: 769px) {

  .voice-container {
    min-width: 550px;
  }
   
  .matching-card {
    min-width: 550px;
  }
  
  .option-btn {
    padding: 16px 20px;
    font-size: 16px;
  }
  
  .option-letter {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-right: 14px;
  }
  
  .card-body {
    padding: 2rem !important;
  }
}

/* ========================================
   ПОЛНОЭКРАННЫЙ РЕЖИМ ОБУЧЕНИЯ
   ======================================== */
body.study-mode .matching-container {
  background: #f5f7fa;
}

body.study-mode .card {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

/* -- */ 

.direction-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 8px;
  }
  .switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
  }
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
  }
  .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
  }
  input:checked + .slider {
    background-color: #b33939;
  }
  input:checked + .slider:before {
    transform: translateX(24px);
  }
  .direction-indicator {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: white;
    font-weight: 600;
    display: inline-block;
  }
  .direction-indicator.a-to-b {
    color: #28a745;
    border-left: 3px solid #28a745;
  }
  .direction-indicator.b-to-a {
    color: #b33939;
    border-left: 3px solid #b33939;
  }