/* faq-widget.css */

.faq-widget {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.faq-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.faq-content-spacing {
  height: 10px;
}

/* Custom Expansion Panel Styles */
.custom-expansion-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.faq-item {
  background-color: #f0f9ff; /* AppColors.kSecondaryLight equivalent */
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.faq-item:hover {
  background-color: #e0f2fe;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item-content {
  padding: 20px;
  width: 100%;
}

.faq-question-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.faq-question-text {
  flex: 1;
  min-width: 0;
}

.faq-question {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
}

.faq-question-spacing {
  width: 10px;
  flex-shrink: 0;
}

.faq-icon-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  font-weight: 600;
  color: #007bff; /* AppColors.kPrimary */
  transition: transform 0.3s ease;
  line-height: 1;
}

.faq-icon-expanded {
  transform: rotate(180deg);
}

.faq-answer-spacing {
  height: 16px;
}

.faq-answer-container {
  width: 100%;
  animation: fadeInDown 0.3s ease;
}

.faq-answer {
  font-size: 14px;
  font-weight: 500;
  color: #424242;
  margin: 0;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Animation for answer expansion */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .faq-title {
    font-size: 14px;
  }
  
  .faq-item-content {
    padding: 16px;
  }
  
  .faq-question {
    font-size: 14px;
  }
  
  .faq-answer {
    font-size: 14px;
  }
  
  .faq-question-spacing {
    width: 8px;
  }
  
  .faq-answer-spacing {
    height: 12px;
  }
  
  .faq-icon {
    width: 20px;
    height: 20px;
    font-size: 16px;
  }
}

/* Tablet responsive styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .faq-item-content {
    padding: 18px;
  }
  
  .faq-question {
    font-size: 15px;
  }
}

/* Focus states for accessibility */
.faq-item:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.faq-item:focus:not(:focus-visible) {
  outline: none;
}

/* Keyboard navigation support */
.faq-item[tabindex="0"]:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Active state */
.faq-item:active {
  transform: translateY(0);
  background-color: #bfdbfe;
}

/* Improved contrast for better readability */
.faq-item-expanded {
  background-color: #dbeafe;
}

.faq-item-expanded:hover {
  background-color: #bfdbfe;
}

/* Loading state */
.faq-widget.loading {
  opacity: 0.7;
  pointer-events: none;
}

.faq-widget.loading .faq-item {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Print styles */
@media print {
  .faq-item {
    background-color: transparent !important;
    border: 1px solid #ccc;
    margin-bottom: 8px;
    page-break-inside: avoid;
  }
  
  .faq-item:hover {
    transform: none;
    box-shadow: none;
  }
  
  .faq-icon {
    display: none;
  }
  
  .faq-answer-container {
    animation: none;
  }
  
  /* Show all answers in print */
  .faq-answer-container {
    display: block !important;
  }
  
  .faq-answer-spacing {
    height: 8px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .faq-item {
    border: 2px solid #000;
    background-color: #ffffff;
  }
  
  .faq-question {
    color: #000;
  }
  
  .faq-answer {
    color: #000;
  }
  
  .faq-icon {
    color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .faq-item {
    transition: none;
  }
  
  .faq-item:hover {
    transform: none;
  }
  
  .faq-icon {
    transition: none;
  }
  
  .faq-icon-expanded {
    transform: none;
  }
  
  .faq-answer-container {
    animation: none;
  }
  
  .faq-widget.loading .faq-item {
    animation: none;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .faq-widget {
    color: #ffffff;
  }
  
  .faq-title {
    color: #ffffff;
  }
  
  .faq-item {
    background-color: #1f2937;
  }
  
  .faq-item:hover {
    background-color: #374151;
  }
  
  .faq-item-expanded {
    background-color: #374151;
  }
  
  .faq-item-expanded:hover {
    background-color: #4b5563;
  }
  
  .faq-question {
    color: #ffffff;
  }
  
  .faq-answer {
    color: #d1d5db;
  }
  
  .faq-icon {
    color: #60a5fa;
  }
}

/* Empty state styling */
.faq-widget:has(.custom-expansion-panel:empty) .faq-title::after {
  content: " (No FAQs available)";
  font-weight: 400;
  color: #6c757d;
  font-size: 0.9em;
}
