/* ==========================================================================
   Product Q&A Styles - Compact Cannabis Theme
   ========================================================================== */

.product-qna-container {
  background: #ffffff;
  border: 1px solid #d1e0d8;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(34, 94, 53, 0.08);
  line-height: 1.5;
}

.product-qna-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 20px 0;
  color: #2d4d2c;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8f4e6;
  text-align: center;
}

.qna-search-container {
  display: flex;
  margin-bottom: 20px;
  gap: 8px;
  align-items: center;
}

.qna-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #2d4d2c;
  width: 100%;
}

.qna-search-input:focus {
  outline: none;
  border-color: #4caf50;
}

.qna-search-button {
  padding: 10px 16px;
  background: linear-gradient(135deg,#4CAF50 0%,#45a049 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.qna-search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(76 175 80 / .4);
}

.qna-list {
  margin-bottom: 20px;
}

.qna-item {
  display: flex;
  padding: 16px 0;
  border-bottom: 1px solid #e8f4e6;
  gap: 16px;
  transition: all 0.2s ease;
}

.qna-item:hover {
  background: #f8fbf9;
  border-radius: 6px;
  margin: 0 -8px;
  padding: 16px 8px;
}

.qna-item:last-child {
  border-bottom: none;
}

/* Compact Vertical voting */
.qna-voting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-right: 16px;
  min-width: 28px;
  flex-shrink: 0;
}

.vote-btn {
  background: #ffffff;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  width: 26px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3A833C;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s ease;
}

.vote-btn:hover {
  background-color: #e8f5e9;
  border-color: #4caf50;
  transform: scale(1.1);
}

.vote-btn.voted {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}

.vote-count {
  font-weight: bold;
  font-size: 12px;
  min-width: 20px;
  text-align: center;
  color: #2d4d2c;
  padding: 2px 0;
}

.vote-label {
  font-size: 10px;
  color: #689f38;
  margin-top: 2px;
  text-align: center;
  line-height: 1.2;
  max-width: 40px;
  word-wrap: break-word;
  font-weight: 500;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease;
}

.qna-item:hover .vote-label {
  opacity: 1;
  transform: translateY(0);
}

.qna-content {
  flex: 1;
  min-width: 0;
}

.question {
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d4d2c;
  font-size: 15px;
  line-height: 1.4;
}

.answer {
  margin-bottom: 12px;
  line-height: 1.5;
  color: #4b6a4b;
  font-size: 14px;	
  padding: 12px;
  background: #f8fbf9;
  border-left: 3px solid #4caf50;
  border-radius: 4px;
}

.qna-meta {
  font-size: 12px;
  color: #547D54;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.qna-acf-badge {
  color: #547D54;
  font-weight: 500;
  font-size: 12px;
}

.qna-empty {
  text-align: center;
  padding: 32px 16px;
  color: #9bc19b;
  font-size: 14px;
}

.qna-form-container {
  border-top: 1px solid #e8f4e6;
  padding-top: 20px;
  margin-top: 16px;
}

.qna-form-container h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #2d4d2c;
  font-weight: bold;
}

.qna-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qna-form textarea,
.qna-form input {
  padding: 10px 12px;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  color: #2d4d2c;
}

.qna-form textarea:focus,
.qna-form input:focus {
  outline: none;
  border-color: #4caf50;
}

.qna-form textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.4;
}

.qna-form button {
  padding: 10px 20px;
  background: linear-gradient(135deg,#4CAF50 0%,#45a049 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  align-self: flex-start;
  transition: all 0.2s ease;
}

.qna-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(76 175 80 / .4);
}

.qna-form-message {
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 13px;
  display: none;
}

.qna-form-message.success {
  background: #e8f5e9;
  color: #2d6a4f;
  border: 1px solid #a5d6a7;
  display: block;
}

.qna-form-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  display: block;
}

/* Responsive design */
@media (max-width: 768px) {
  .product-qna-container {
    padding: 16px;
    margin: 20px 0;
  }
  
  .qna-search-container {
    flex-direction: column;
    gap: 8px;
  }
  
  .qna-search-button {
    width: 100%;
  }
  
  .qna-item {
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }
  
  .qna-item:hover {
    margin: 0 -4px;
    padding: 12px 4px;
  }
  
  .qna-voting {
    flex-direction: row;
    gap: 12px;
    margin-right: 0;
    margin-bottom: 8px;
    justify-content: center;
  }
  
  .vote-label {
    display: none;
  }
  
  .qna-meta {
  /*  flex-direction: column; */
    gap: 4px;
    align-items: flex-start;
  }
  
  .qna-form button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .product-qna-container {
    padding: 12px;
  }
  
  .product-qna-title {
    font-size: 20px;
    margin-bottom: 16px;
  }
  
  .qna-form textarea,
  .qna-form input {
    padding: 8px 10px;
  }
  
  .answer {
    padding: 10px 12px;
  }
}

/* Loading spinner styles */
.qna-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: qna-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes qna-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure the button has proper styling when loading */
.qna-form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Optional: Add transition for smoother state changes */
.qna-form button[type="submit"] {
    transition: all 0.3s ease;
}