/* ═══════════════════════════════════════════════════════════════════════
   MNEMOTEHNIC WIDGETS CSS
   Versiunea: 1.0 | Martie 2026
   
   Sistem modular de widget-uri interactive pentru documente mnemotehnice:
   - Rating cu stele (per secțiune: Lecția, Tehnica, Șocul Vizual, etc.)
   - Suggestion widgets (pentru feedback și îmbunătățiri)
   
   Utilizare: Include acest fișier în <head> sau copiază CSS-ul în <style>
   ═══════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   1. BLOCK-LEVEL RATINGS (per secțiune individuală)
   ══════════════════════════════════════════════════════════════ */

.block-rating-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0 0;
  padding: 7px 12px;
  background: #0d1b2a;
  border: 1.5px solid #1a6fa8;
  border-radius: 0 0 6px 6px;
  border-top: none;
}

.block-rating-widget .br-type {
  font-size: 10px;
  font-weight: 700;
  color: #7ecfff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 110px;
}

.block-rating-widget .br-stars {
  display: flex;
  gap: 2px;
}

.block-rating-widget .br-star {
  font-size: 18px;
  cursor: pointer;
  color: #333;
  line-height: 1;
  user-select: none;
  transition: color 0.1s, transform 0.08s, text-shadow 0.1s;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.block-rating-widget .br-star:hover {
  transform: scale(1.22);
  color: #ff9900;
  text-shadow: 0 0 6px rgba(255, 153, 0, 0.7);
}

.block-rating-widget .br-star.active {
  color: #f5a623;
  text-shadow: 0 0 5px rgba(245, 166, 35, 0.6);
}

.block-rating-widget .br-info {
  font-size: 11px;
  color: #7ecfff;
}

.block-rating-widget .br-own {
  font-size: 10px;
  color: #aaa;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 20px;
  background: #1a252f;
  border: 1px solid #2d5a7f;
  white-space: nowrap;
}

.block-rating-widget .br-own.voted {
  background: #1a6fa8;
  color: #fff;
  font-weight: 700;
  border-color: #1a6fa8;
}

/* ══════════════════════════════════════════════════════════════
   2. SUGGESTION WIDGET (per paragraf)
   ══════════════════════════════════════════════════════════════ */

.suggestion-widget {
  margin: 6px 16px 20px 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px dashed #c08030;
  background: #0e0e0e;
}

.sw-toggle {
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  background: #1c1200;
  border: none;
  color: #f5c060;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.sw-toggle:hover {
  background: #261800;
}

.sw-arrow {
  margin-left: 6px;
  transition: transform 0.2s;
  font-style: normal;
}

.suggestion-widget.sw-open .sw-arrow {
  transform: rotate(180deg);
}

.sw-body {
  display: none;
  padding: 14px 16px 16px;
  border-top: 1px solid #2a1800;
}

.suggestion-widget.sw-open .sw-body {
  display: block;
}

.sw-desc {
  font-size: 12px;
  color: #c0a060;
  margin: 0 0 14px 0;
  line-height: 1.6;
}

.sw-row {
  margin-bottom: 12px;
}

.sw-row label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #f5a623;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sw-select,
.sw-text {
  width: 100%;
  padding: 8px 10px;
  background: #1a1200;
  border: 1px solid #3a2800;
  border-radius: 5px;
  color: #e0d0a0;
  font-size: 12.5px;
  font-family: inherit;
}

.sw-select:focus,
.sw-text:focus {
  outline: none;
  border-color: #f5a623;
  background: #221800;
}

.sw-text {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

.sw-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.sw-submit {
  background: #f5a623;
  color: #1a1200;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sw-submit:hover {
  background: #ff9900;
  transform: scale(1.03);
}

.sw-submit:disabled {
  background: #666;
  cursor: not-allowed;
}

.sw-status {
  font-size: 11px;
  color: #aaa;
}

.sw-ai-hint {
  margin-top: 12px;
  padding: 10px;
  background: #0a0800;
  border-left: 3px solid #f5a623;
  font-size: 11px;
  color: #b0a060;
  line-height: 1.5;
  border-radius: 0 5px 5px 0;
}

.sw-ai-hint strong {
  color: #f5a623;
}

.sw-ai-hint em {
  color: #d0c080;
  font-style: italic;
}

.sw-copy-area {
  margin-top: 12px;
  padding: 10px;
  background: #0a0800;
  border-radius: 5px;
  border: 1px solid #3a2800;
}

.sw-copy-text {
  width: 100%;
  padding: 6px;
  background: #1a1200;
  border: 1px solid #2a1800;
  border-radius: 4px;
  font-size: 11px;
  color: #c0a060;
  font-family: monospace;
  resize: none;
}

.sw-copy-btn {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

.sw-copy-btn:hover {
  background: #229954;
}

/* ══════════════════════════════════════════════════════════════
   3. RESPONSIVE (Mobile ≤ 640px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .block-rating-widget {
    padding: 5px 8px;
    gap: 4px;
  }
  
  .block-rating-widget .br-star {
    font-size: 14px !important;
  }
  
  .block-rating-widget .br-type {
    font-size: 9px !important;
    min-width: 85px;
  }
  
  .suggestion-widget {
    margin: 6px 8px 16px 8px;
  }
  
  .sw-toggle {
    padding: 8px 12px;
    font-size: 11.5px;
  }
  
  .sw-body {
    padding: 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   4. PRINT (Ascunde widget-uri la print)
   ══════════════════════════════════════════════════════════════ */

@media print {
  .block-rating-widget,
  .suggestion-widget {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   5. TOAST NOTIFICATIONS (pentru feedback)
   ══════════════════════════════════════════════════════════════ */

#toast-global {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a252f;
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99997;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#toast-global.show {
  opacity: 1;
}
