/* ==========================================
   FAQ Widget Spacing - With Body Classes
   ========================================== */

/* DEFAULT: Generous spacing for all pages */
#uttik-faq-section,
.uttik-faq-section {
    width: 100%;
    padding: 10px 20px 40px 20px;
    margin-top: 10px;
    margin-bottom: 40px;
}

/* FAQ Index Page: Minimal spacing (widget is main content) */
body.uttik-faq-index-page #uttik-faq-section,
body.uttik-faq-index-page .uttik-faq-section {
    margin-top: 0;
    padding-top: 0px !important;
}

/* Single FAQ Pages: Keep generous spacing (widget is auto-added) */
body.uttik-faq-single-page #uttik-faq-section,
body.uttik-faq-single-page .uttik-faq-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 0px solid #e5e7eb;
}

/* Pages with auto-widget: Ensure proper separation from footer */
body.has-uttik-auto-widget #uttik-faq-section,
body.has-uttik-auto-widget .uttik-faq-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 0px solid #e5e7eb;
    display: flex;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #uttik-faq-section,
    .uttik-faq-section {
        padding: 40px 15px;
        margin-top: 40px;
    }
    
    body.uttik-faq-index-page #uttik-faq-section,
    body.uttik-faq-index-page .uttik-faq-section {
        margin-top: 0;
        padding-top: 10px;
    }
    
    body.has-uttik-auto-widget #uttik-faq-section,
    body.has-uttik-auto-widget .uttik-faq-section {
        margin-top: 10px;
        padding-top: 10px;
    }
}

  
  .uttik-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .uttik-header {
    text-align: center;
    margin-bottom: 50px;
    animation: uttikFadeInDown 0.6s ease-out;
  }
  
  .uttik-subtitle {
    color: #4f46e5;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
  }
  
  .uttik-title {
    color: #111827;
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 10px 0 8px 0;
  }
  
  .uttik-faq-count {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.95rem;
  }
  
  .uttik-faq-count svg {
    width: 18px;
    height: 18px;
    margin-right: 6px;
  }
  
  .uttik-search-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    animation: uttikFadeIn 0.8s ease-out;
  }
  
  .uttik-search-box input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    background: transparent;
  }
  
  .uttik-search-box input::placeholder {
    color: #9ca3af;
  }
  
  .uttik-faq-list {
    animation: uttikFadeInUp 0.8s ease-out;
  }
  
  .uttik-faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  
  .uttik-faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
  }
  
  .uttik-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    cursor: pointer;
    user-select: none;
  }
  
  .uttik-faq-question h3 {
    flex: 1;
    margin: 0;
    margin-right: 20px;
    line-height: 1.5;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
  }
  
  .uttik-faq-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }
  
  .uttik-faq-item.active .uttik-faq-icon {
    background: #dbeafe;
    transform: rotate(180deg);
  }
  
  .uttik-faq-icon svg {
    width: 18px;
    height: 18px;
    fill: #6b7280;
    transition: all 0.3s ease;
  }
  
  .uttik-faq-item.active .uttik-faq-icon svg {
    fill: #4f46e5;
  }
  
  .uttik-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
  }
  
  .uttik-faq-answer.open {
    max-height: 500px;
    padding: 0 24px 24px 24px;
  }
  
  .uttik-faq-answer p {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
  }
  
  .uttik-faq-answer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    gap: 4px;
  }
  
  .uttik-faq-answer a:hover {
    color: #6366f1;
    gap: 8px;
  }

  .uttik-faq-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      border-top: 1px solid #eee;
      padding-top: 10px;
      margin-top: 15px;
  }

  .uttik-faq-actions a {
      color: #9ca3af;
      padding: 4px;
      transition: color 0.2s ease;
      display: inline-flex;
      align-items: center;
  }
  
  .uttik-faq-actions a:not(.uttik-read-more):hover {
      color: #4f46e5; /* Hover color for icons */
  }

  .uttik-faq-actions a.uttik-read-more {
      margin-right: auto;
      color: #4f46e5;
      font-weight: 500;
      text-decoration: none;
      padding: 0;
  }
  
  #uttik-faq-empty,
  #uttik-faq-loading {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
  }
  
  #uttik-faq-empty svg,
  #uttik-faq-loading svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    fill: #9ca3af;
  }
  
  #uttik-faq-loading svg {
    animation: uttikSpin 1s linear infinite;
  }
  
  #uttik-faq-empty h3,
  #uttik-faq-loading h3 {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 10px;
    font-weight: 600;
  }
  
  #uttik-faq-empty p,
  #uttik-faq-loading p {
    color: #9ca3af;
    font-size: 15px;
  }
  
  .uttik-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    animation: uttikFadeIn 1.2s ease-out;
  }
  
  .uttik-pagination button {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
  }
  
  .uttik-pagination button:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #4f46e5;
    color: #4f46e5;
  }
  
  .uttik-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  
  .uttik-pagination button.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
  }
  
  .uttik-pagination-dots {
    padding: 10px 8px;
    color: #9ca3af;
    user-select: none;
  }
  
  /* Support CTA */
  .uttik-support-cta {
    text-align: center;
    margin-top: 40px;
  }
  
  .uttik-support-cta p {
    color: #4b5563;
    font-weight: 600;
    margin-bottom: 14px;
  }
  
  .uttik-support-btn {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
    transition: transform .05s ease, box-shadow .2s ease;
  }
  
  .uttik-support-btn:hover {
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
  }
  
  .uttik-support-btn:active {
    transform: translateY(1px);
  }
  
  /* Modal Styles */
  .uttik-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: uttikFadeIn 0.3s ease;
  }
  
  .uttik-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .uttik-modal {
    background: white;
    margin:auto;
    color: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: uttikSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
  }
  
  .uttik-modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .uttik-modal-title {
    font-size: 24px;
    color:#ffffff;
    font-weight: 700;
    margin: 0;
  }
  
  .uttik-close-button {
    
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: background 0.2s ease;
    line-height: 1;
  }
  
  .uttik-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
  }
  
  .uttik-modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
  }
  
  #uttik-modal-search {
    margin-bottom: 20px;
  }
  
  #uttik-modal-search input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    outline: none;
  }
  
  #uttik-modal-faq-empty,
  #uttik-modal-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
  }
  
  .uttik-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: uttikSpin 1s linear infinite;
    margin: 0 auto 16px;
  }
  
  /* Support Form */
  #uttik-support-form {
    padding: 10px 0;
  }
  
  #uttik-support-form h3 {
    margin-bottom: 20px;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
  }
  
  .uttik-form-group {
    margin-bottom: 16px;
  }
  
  .uttik-form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    
  }
  
  .uttik-form-group input,
  .uttik-form-group textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    color: #111827;
  }
  
  .uttik-form-group textarea {
    resize: vertical;
    min-height: 120px;
  }
  
  .uttik-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
  }
  
  .uttik-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
  }
  
  .uttik-btn-primary {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
  }
  
  /* Sticky Button */
  .uttik-sticky-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 260px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 9998;
  }
  
  .uttik-sticky-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
  }
  
  .uttik-sticky-button:active {
    transform: translateY(0);
  }
  
  .uttik-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }
  
  .uttik-faq-open-button {
    display: inline-block;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
  }
  
  /* Animations */
  @keyframes uttikFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes uttikFadeInDown {
    from { opacity: 0; transform: translateY(-20px);}
    to { opacity:1; transform: translateY(0);}
  }
  
  @keyframes uttikFadeInUp {
    from { opacity:0; transform: translateY(20px);}
    to { opacity:1; transform: translateY(0);}
  }
  
  @keyframes uttikSlideUp {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes uttikSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Responsive Styles */
  @media (max-width: 768px) {
    .uttik-faq-section {
      padding: 40px 16px;
    }
    
    .uttik-title {
      font-size: 2rem;
    }
    
    .uttik-search-box {
      padding: 12px 16px;
    }
    
    .uttik-faq-question {
      padding: 20px 16px;
    }
    
    .uttik-faq-question h3 {
      font-size: 1rem;
    }
    
    .uttik-faq-answer.open {
      padding: 0 16px 20px 16px;
    }
    
    .uttik-faq-icon {
      width: 28px;
      height: 28px;
    }
    
    .uttik-faq-icon svg {
      width: 16px;
      height: 16px;
    }
    
    .uttik-pagination {
      gap: 6px;
    }
    
    .uttik-pagination button {
      padding: 8px 12px;
      font-size: 13px;
      min-width: 36px;
    }
    
    .uttik-sticky-button {
      width: auto;
      padding: 14px 18px;
      font-size: 14px;
    }
  }
  

    /* Container for the FAQ */
    .uttik-single-container {
        max-width: 900px;
        margin: 0 auto;
        padding: 20px;
    }
    
    /* FAQ Card */
    .uttik-single-faq {
        margin: 30px 0;
        padding: 20px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    /* FAQ Title */
    .uttik-single-faq-title {
        margin-bottom: 20px;
        font-weight: 700;
    }
    
    /* FAQ Answer - CRITICAL FIXES */
    .uttik-single-answer {
        /* Override any problematic styles from widget */
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        
        /* Basic styling - using default theme colors */
        line-height: 1.7;
        margin-bottom: 30px;
    }
    
    /* Markdown styling */
    .uttik-single-answer ul, 
    .uttik-single-answer ol {
        margin-left: 20px;
        padding-left: 20px;
        margin-bottom: 1em;
        margin-top: 1em;
    }
    
    .uttik-single-answer ul {
        list-style-type: disc;
    }
    
    .uttik-single-answer ol {
        list-style-type: decimal;
    }
    
    .uttik-single-answer li {
        margin-bottom: 0.5em;
        display: list-item;
    }
    
    .uttik-single-answer strong {
        font-weight: bold;
    }
    
    .uttik-single-answer em {
        font-style: italic;
    }
    
    /* Paragraph spacing */
    .uttik-single-answer p {
        margin-bottom: 15px;
    }
    
    /* Back link section */
    .uttik-single-back {
        margin-top: 30px;
        border-top: 1px solid #e5e7eb;
        padding-top: 20px;
    }
    
    /* Back link styling */
    .uttik-single-back a {
        display: inline-flex;
        align-items: center;
        text-decoration: none;
        font-weight: 500;
        gap: 4px;
        transition: all 0.2s ease;
    }
    
    .uttik-single-back a:hover {
        gap: 8px;
    }

