/* Mood Popup - Stiluri pentru pop-up-ul empatic "Cum te simți azi?" */

/* Overlay principal */
.mood-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.mood-popup-overlay.show {
  opacity: 1;
}

/* Previne scrollbar-ul orizontal când popup-ul este activ */
body.mood-popup-open {
  overflow-x: hidden;
}

/* Container pop-up */
.mood-popup-container {
  background: white;
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 90%;
  /* Pe Safari mobil, vh ignoră bara de adrese și bara de jos, deci 90vh poate depăși
     zona vizibilă: titlul rămâne tăiat sus, iar butonul de închidere sub ecran.
     dvh ține cont de interfața browserului; vh rămâne ca rezervă pentru browsere vechi. */
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-sizing: border-box;
  padding: 0;
  margin: 1rem;
}

.mood-popup-overlay.show .mood-popup-container {
  transform: scale(1) translateY(0);
}

.mood-popup-content {
  padding: 2rem;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Header pentru întrebare */
.mood-header {
  text-align: center;
  margin-bottom: 2rem;
  box-sizing: border-box;
  overflow: visible;
}

.mood-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 auto 0.5rem auto;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  min-width: 100px;
}

.mood-header p {
  font-size: 1.1rem;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* Butoane pentru stări emoționale */
.mood-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.mood-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.mood-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: #59A52C;
}

.mood-btn:active {
  transform: translateY(-2px);
}

.mood-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.mood-text {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

/* Culori specifice pentru fiecare stare */
.mood-btn[data-mood="happy"]:hover {
  background: #FFF6A3;
  border-color: #FFF6A3;
}

.mood-btn[data-mood="sad"]:hover {
  background: #C7DAF0;
  border-color: #C7DAF0;
}

.mood-btn[data-mood="angry"]:hover {
  background: #F4B1A1;
  border-color: #F4B1A1;
}

.mood-btn[data-mood="anxious"]:hover {
  background: #C9EACB;
  border-color: #C9EACB;
}

.mood-btn[data-mood="optimistic"]:hover {
  background: #FFD5A5;
  border-color: #FFD5A5;
}

/* Acțiuni */
.mood-actions {
  text-align: center;
}

.mood-close-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mood-close-btn:hover {
  background: #e2e8f0;
  color: #374151;
}

/* Ecran recomandare */
.recommendation-header {
  text-align: center;
  margin-bottom: 2rem;
}

.recommendation-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 3em;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  text-align: center !important;
  display: block;
  width: 100%;
}

.recommendation-content {
  margin-bottom: 2rem;
}

/* Card carte */
.book-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.book-icon {
  font-size: 4.5rem;
  flex-shrink: 0;
}

.book-info {
  flex: 1;
}

.book-title {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.book-author {
  font-size: 1rem;
  color: #59A52C;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.book-description {
  font-size: 16px;
  color: #000000;
  line-height: 1.5;
  margin: 0;
}

/* Mesaj empatic */
.empathic-message {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #bae6fd;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

.empathic-message p {
  font-size: 1.1rem;
  color: #0c4a6e;
  font-weight: 600;
  margin: 0;
  line-height: 1.5;
}

/* Acțiuni recomandare */
.recommendation-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.mood-back-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mood-back-btn:hover {
  background: #e2e8f0;
  color: #374151;
}

/* Culori dinamice pentru butoanele site-ului */
.mood-theme-active .btn,
.mood-theme-active .btn-cta,
.mood-theme-active .mood-btn,
.mood-theme-active button:not(.mood-close-btn):not(.mood-back-btn) {
  background-color: var(--mood-theme-color, #59A52C) !important;
  border-color: var(--mood-theme-color, #59A52C) !important;
  color: #1e293b !important;
  transition: all 0.3s ease !important;
}

.mood-theme-active .btn:hover,
.mood-theme-active .btn-cta:hover,
.mood-theme-active button:not(.mood-close-btn):not(.mood-back-btn):hover {
  background-color: var(--mood-theme-color, #59A52C) !important;
  filter: brightness(0.9) !important;
  transform: translateY(-2px) !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .mood-popup-container {
    width: 95%;
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .mood-popup-content {
    padding: 1.5rem;
    min-width: 0;
  }
  
  .mood-header {
    padding: 0;
    min-width: 0;
  }
  
  .mood-header h2 {
    font-size: 2rem;
    padding: 0;
  }
  
  .mood-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .mood-btn {
    padding: 1rem 0.75rem;
  }
  
  .mood-emoji {
    font-size: 2rem;
  }
  
  .mood-text {
    font-size: 0.9rem;
  }
  
  .book-card {
    flex-direction: column;
    text-align: center;
  }
  
  .recommendation-actions {
    flex-direction: column;
  }
  
  .mood-back-btn,
  .mood-close-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .mood-popup-container {
    width: calc(100vw - 1rem);
    margin: 0.5rem;
  }

  .mood-popup-content {
    padding: 1rem;
  }

  .mood-buttons {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
  }

  /* Pe telefon punem emoji-ul și textul pe același rând: cinci carduri verticale
     depășeau înălțimea ecranului. Așa se înjumătățește înălțimea fiecărui buton. */
  .mood-btn {
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .mood-emoji {
    font-size: 1.75rem;
  }
  
  .mood-header {
    padding: 0;
  }
  
  .mood-header h2 {
    font-size: 1.75rem;
    padding: 0;
    line-height: 1.3;
  }
  
  .mood-header p {
    font-size: 1rem;
    padding: 0;
  }
}

/* Animații pentru intrare */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mood-screen,
.recommendation-screen {
  animation: fadeInUp 0.4s ease;
}

/* Scrollbar personalizat pentru pop-up */
.mood-popup-container::-webkit-scrollbar {
  width: 8px;
}

.mood-popup-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.mood-popup-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.mood-popup-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Buton reset culori */
.mood-reset-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.mood-reset-btn:hover {
  background: #e2e8f0;
  color: #374151;
  transform: translateY(-1px);
}

.mood-reset-btn i {
  font-size: 0.8rem;
}

/* Notificare reset */
.mood-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  z-index: 10001;
  font-weight: 600;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive pentru butonul de reset */
@media (max-width: 768px) {
  .mood-reset-btn {
    margin-left: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .mood-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}
