/* ============================================
   QUEST4COUPLE - QUESTIONS STYLES
   Estilos das perguntas e questionários
   ============================================ */

/* === PACK CONTAINER === */
.pack { 
  margin-bottom: 20px; 
  border-radius: 20px; 
  color: white; 
  overflow: hidden; 
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: none;
  transition: all 0.3s ease;
}

.pack.active {
  display: block;
  animation: slideIn 0.4s ease-out;
}

/* ✅ NOVO: Collapse/Expand States */
.pack.collapsed .pack-content {
  display: none;
}

.pack.collapsed .pack-footer {
  display: none;
}

.pack.collapsed .response-guide {
  display: none;
}

.pack.expanded .pack-content {
  display: block;
  animation: expandQuestions 0.3s ease-out;
}

.pack.expanded .pack-footer {
  display: block;
}

.pack.expanded .response-guide {
  display: block;
}

@keyframes expandQuestions {
  from { 
    opacity: 0; 
    max-height: 0;
  }
  to { 
    opacity: 1; 
    max-height: 10000px;
  }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === REAL-TIME SYNC ANIMATION === */
@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% { 
    transform: scale(1.02); 
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
}

/* === PACK HEADER === */
.pack-header { 
  padding: 25px 30px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  user-select: none;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.2s ease;
}

.pack-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pack-header h2 { 
  margin: 0; 
  font-size: 1.8em; 
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ✅ NOVO: Pack progress badge */
.pack-progress-badge {
  font-size: 0.5em;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ✅ NOVO: Collapse/Expand - Ícone discreto */
.pack-toggle-icon {
  font-size: 0.8em;
  transition: transform 0.3s ease;
  cursor: pointer;
  opacity: 0.7;
  display: inline-block;
  user-select: none;
}

.pack-toggle-icon:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Badge de progresso */
.pack-progress-badge {
  font-size: 0.7em;
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: auto;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pack-progress-badge.complete {
  background: rgba(76, 175, 80, 0.5);
}

.pack-progress-badge.in-progress {
  background: rgba(33, 150, 243, 0.5);
}

.pack-progress-badge.empty {
  background: rgba(158, 158, 158, 0.3);
}

.back-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateX(-3px);
}

/* === RESPONSE GUIDE === */
.response-guide {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 25px;
  margin: 20px;
  color: white;
  animation: fadeIn 0.5s ease-out;
}

.response-guide h3 {
  margin: 0 0 10px 0;
  font-size: 1.5em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.response-guide > p {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 20px;
  opacity: 0.95;
}

.guide-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.guide-option {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.guide-option:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.guide-emoji {
  font-size: 2.5em;
  display: block;
  margin-bottom: 8px;
}

.guide-option strong {
  display: block;
  font-size: 1.2em;
  margin-bottom: 8px;
}

.guide-option p {
  font-size: 0.9em;
  line-height: 1.4;
  margin: 0;
  opacity: 0.9;
}

.guide-option u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.btn-understand {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.9);
  color: #d63384;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-understand:hover {
  background: white;
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-understand:active {
  transform: scale(0.98);
}

/* === PACK CONTENT === */
.pack-content { 
  max-height: none; 
  overflow: visible; 
  padding: 20px 0;
}

/* === PACK FOOTER === */
.pack-footer {
  padding: 25px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-add-custom {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 25px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-add-custom::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-add-custom:hover::before {
  width: 300px;
  height: 300px;
}

.btn-add-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-add-custom:active {
  transform: translateY(0);
}

/* === CATEGORY WRAPPER (Collapse/Expand) === */
.category-wrapper {
  margin: 15px 0;
}

.category-wrapper.collapsed .category-questions {
  display: none;
}

.category-wrapper.expanded .category-questions {
  display: block;
  animation: expandCategory 0.3s ease-out;
}

@keyframes expandCategory {
  from { 
    opacity: 0; 
    max-height: 0;
  }
  to { 
    opacity: 1; 
    max-height: 10000px;
  }
}

/* === CATEGORY TITLE === */
.category-title {
  margin-top: 25px;
  margin-bottom: 15px;
  padding: 12px 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.3em;
  color: white;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.category-title:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.category-toggle-icon {
  font-size: 0.7em;
  transition: transform 0.3s ease;
  opacity: 0.8;
  display: inline-block;
}

.category-name {
  flex: 1;
}

.category-progress-badge {
  font-size: 0.6em;
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.category-questions {
  padding-left: 10px;
}

/* === QUESTION === */
.question { 
  margin: 5px 15px; 
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  display: block;
  min-height: auto;
}

.question-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 15px;
  background-color: rgba(255,255,255,0.08);
  border-radius: 8px;
  margin-bottom: 5px;
  border-left: 3px solid rgba(255,255,255,0.2);
}

.question-content {
  flex: 1;
  display: flex;
  align-items: center;
}

.question-text { 
  font-weight: 500; 
  line-height: 1.4; 
  font-size: 15px; 
  margin: 0;
  color: white;
}

/* === OPTIONS === */
.question-options { 
  display: flex; 
  justify-content: flex-end;
  align-items: center; 
  gap: 20px;
  flex-shrink: 0;
  min-width: 320px;
}

.option-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.option-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-options input[type="radio"] { 
  width: 22px; 
  height: 22px; 
  cursor: pointer;
  appearance: none;
  border: 2.5px solid white;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
  background: transparent;
}

.question-options input[type="radio"]:hover {
  transform: scale(1.15);
}

/* === CORES POR OPÇÃO === */
/* "Por favor!" - Azul preenchido com estrela */
.option-item:nth-child(1) input[type="radio"] {
  border-color: #4a90e2;
}

.option-item:nth-child(1) input[type="radio"]:checked {
  background: #4a90e2;
  border-color: #4a90e2;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.option-item:nth-child(1) input[type="radio"]:checked::after {
  content: '⭐';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

/* "Yup" - Verde com visto */
.option-item:nth-child(2) input[type="radio"] {
  border-color: #28a745;
}

.option-item:nth-child(2) input[type="radio"]:checked {
  background: #28a745;
  border-color: #28a745;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.option-item:nth-child(2) input[type="radio"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* "Meh..." (3º posição) - Vermelho com X */
.option-item:nth-child(3) input[type="radio"] {
  border-color: #dc3545;
}

.option-item:nth-child(3) input[type="radio"]:checked {
  background: #dc3545;
  border-color: #dc3545;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.option-item:nth-child(3) input[type="radio"]:checked::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
}

/* "Talvez" (4º posição) - Amarelo preenchido com contorno preto */
.option-item:nth-child(4) input[type="radio"] {
  border-color: #d4a574;
}

.option-item:nth-child(4) input[type="radio"]:checked {
  background: #d4a574;
  border-color: #000000;
  border-width: 3px;
  box-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
}

/* === COMMENT === */
.question-comment {
  width: 100%;
  padding: 0 15px 8px 15px;
}

.question-comment textarea {
  width: 100%; 
  height: 40px; 
  padding: 8px 12px; 
  border-radius: 5px; 
  border: 1px solid rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.95);
  color: #333;
  resize: vertical; 
  font-size: 13px; 
  min-height: 40px;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.question-comment textarea:focus {
  outline: none;
  border-color: #28a745;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.question-comment textarea::placeholder {
  color: #999;
  font-style: italic;
}

/* === CUSTOM QUESTION MODAL === */
.custom-question-modal {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.custom-modal-header {
  background: linear-gradient(135deg, #d63384, #e83e8c);
  color: white;
  padding: 20px 30px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-modal-header h2 {
  margin: 0;
  font-size: 1.5em;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.custom-modal-body {
  padding: 30px;
}

.custom-modal-body label {
  display: block;
  font-size: 1.1em;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.custom-modal-body textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.custom-modal-body textarea:focus {
  outline: none;
  border-color: #d63384;
  box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
}

.custom-hint {
  margin-top: 15px;
  padding: 12px;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 5px;
  font-size: 0.9em;
  color: #856404;
}

.custom-modal-footer {
  padding: 20px 30px;
  background: #f8f9fa;
  border-radius: 0 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

.btn-cancel,
.btn-add {
  padding: 12px 30px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-add {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-add:active,
.btn-cancel:active {
  transform: translateY(0);
}

/* Custom question badge */
.custom-question-badge {
  display: inline-block;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 10px;
  vertical-align: middle;
}

/* Custom question styles */
.custom-question {
  border-left: 4px solid #28a745;
  background: linear-gradient(to right, rgba(40, 167, 69, 0.05), transparent);
}

.custom-category-title {
  color: #28a745;
  border-bottom-color: #28a745;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-delete-custom {
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid rgba(220, 53, 69, 0.3);
  color: #dc3545;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  margin-left: 10px;
  transition: all 0.3s ease;
  vertical-align: middle;
}

.btn-delete-custom:hover {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
  transform: scale(1.1);
}

.btn-delete-custom:active {
  transform: scale(0.95);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .question { margin: 5px 10px; }
  .question-row { padding: 10px; }
  .question-text { font-size: 14px; }
  .option-label { font-size: 10px; }
  .question-options input[type="radio"] { 
    width: 18px; 
    height: 18px; 
  }
    .option-item:nth-child(1) input[type="radio"]:checked::after,
  .option-item:nth-child(2) input[type="radio"]:checked::after,
  .option-item:nth-child(3) input[type="radio"]:checked::after {
    font-size: 10px;
  }
  
  .pack-header { padding: 12px 15px; }
  .pack-header h2 { font-size: 16px; }
  
  .back-btn {
    padding: 8px 15px;
    font-size: 0.8em;
  }
  
  .response-guide {
    padding: 20px 15px;
    margin: 15px;
  }
  
  .response-guide h3 {
    font-size: 1.3em;
  }
  
  .guide-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .guide-emoji {
    font-size: 2em;
  }
  
  .guide-option {
    padding: 12px;
  }
  
  .guide-option strong {
    font-size: 1.1em;
  }
  
  .guide-option p {
    font-size: 0.85em;
  }
  
  .btn-understand {
    font-size: 1em;
    padding: 12px 20px;
  }

  .custom-question-modal {
    width: 95%;
    max-width: none;
  }
  
  .custom-modal-header h2 {
    font-size: 1.2em;
  }
  
  .custom-modal-body {
    padding: 20px 15px;
  }
  
  .custom-modal-footer {
    padding: 15px;
    flex-direction: column;
  }
  
  .btn-cancel,
  .btn-add {
    width: 100%;
  }
  
  .btn-add-custom {
    font-size: 0.9em;
    padding: 10px 20px;
  }
  
  .btn-delete-custom {
    padding: 3px 6px;
    font-size: 0.8em;
  }
  
  .custom-question-badge {
    font-size: 0.65em;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .question-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .question-options {
    justify-content: space-around;
    gap: 15px;
  }
  
  .question-comment {
    padding: 0 10px 8px 10px;
  }
}

@media print {
  .pack { page-break-inside: avoid; }
}
