/**
 * Modern FAQ Tab Styles
 * Complete redesign with glass-morphism, animations and dark theme support
 */

/* ========================================
   FAQ Container and Layout
   ======================================== */

.product-faq-content {
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

.product-faq-content.initialized {
    opacity: 1;
}

/* ========================================
   FAQ Filter Area - Modern Design
   ======================================== */

.faq-filter-area {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.03) 0%, rgba(229, 146, 76, 0.03) 100%);
    border: 1px solid rgba(0, 95, 95, 0.08);
    border-radius: 30px;
}

/* Dark mode filter area */
[data-theme="dark"] .faq-filter-area {
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.08) 0%, rgba(229, 146, 76, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.faq-filter-wrapper {
    flex: 1;
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 15px;
    border-radius: 24px;
}

.faq-filter-wrapper::-webkit-scrollbar {
    display: none;
}

.faq-filter-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: min-content;
}

/* Modern Filter Buttons */
.faq-filter-button {
    white-space: nowrap;
    padding: 10px 20px;
    background: white;
    border: 2px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    color: var(--tty-text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Dark mode filter buttons */
[data-theme="dark"] .faq-filter-button {
    background: var(--tty-bg-secondary);
    color: var(--tty-text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.faq-filter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 95, 95, 0.1), transparent);
    transition: left 0.5s ease;
}

.faq-filter-button:hover::before {
    left: 100%;
}

.faq-filter-button:hover {
    background: var(--tty-bg-secondary);
    border-color: var(--tty-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 95, 95, 0.15);
}

[data-theme="dark"] .faq-filter-button:hover {
    background: var(--tty-bg-tertiary);
    border-color: var(--tty-primary-light);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.faq-filter-button.active {
    background: linear-gradient(135deg, var(--tty-primary) 0%, var(--tty-primary-light) 100%);
    color: white;
    border-color: var(--tty-primary);
    box-shadow: 0 4px 15px rgba(0, 95, 95, 0.3);
}

[data-theme="dark"] .faq-filter-button.active {
    background: linear-gradient(135deg, var(--tty-primary-dark) 0%, var(--tty-primary) 100%);
    border-color: var(--tty-primary-dark);
}

/* Scroll Arrows - Modern Style */
.faq-scroll-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: white;
    border: 2px solid var(--tty-border-light);
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: var(--tty-primary);
}

[data-theme="dark"] .faq-scroll-arrow {
    background: var(--tty-bg-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--tty-primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.faq-scroll-arrow:hover {
    background: var(--tty-primary);
    color: white;
    border-color: var(--tty-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 95, 95, 0.3);
}

[data-theme="dark"] .faq-scroll-arrow:hover {
    background: var(--tty-primary-dark);
    border-color: var(--tty-primary-dark);
}

.faq-scroll-arrow.active {
    display: flex;
}

.faq-scroll-left {
    left: -21px;
}

.faq-scroll-right {
    right: -21px;
}

/* ========================================
   FAQ Headers - Modern Style
   ======================================== */

.faq-header {
  padding: 20px 0 15px 0;
  margin-top: -20px;
  margin-bottom: 24px;
  font-size: 24px;
  color: var(--tty-header-primary);
  position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--tty-primary) 0%, transparent 100%);
    border-radius: 2px;
}

[data-theme="dark"] .faq-header {
    color: var(--tty-text-primary);
}

[data-theme="dark"] .faq-header::before {
    background: linear-gradient(90deg, var(--tty-primary-light) 0%, transparent 100%);
}

.faq-header:first-child {
    margin-top: 0;
    padding-top: 0;
}

.faq-header.filtered-out {
    display: none;
}

/* ========================================
   FAQ Items - Glass Morphism Design
   ======================================== */

.faq-item {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 95, 95, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .faq-item {
    background: rgba(45, 45, 45, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 95, 95, 0.12);
    border-color: var(--tty-primary);
}

[data-theme="dark"] .faq-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--tty-primary-light);
}

.faq-item.active {
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.05) 0%, rgba(229, 146, 76, 0.05) 100%);
    border-color: var(--tty-primary);
    box-shadow: 0 6px 20px rgba(0, 95, 95, 0.15);
}

[data-theme="dark"] .faq-item.active {
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.15) 0%, rgba(229, 146, 76, 0.15) 100%);
    border-color: var(--tty-primary-light);
}

/* FAQ Question - Modern Style */
.faq-question {
    padding: 20px 24px;
    background: transparent;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    color: var(--tty-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

[data-theme="dark"] .faq-question {
    color: var(--tty-text-primary);
}

.faq-question:hover {
    background: rgba(0, 95, 95, 0.03);
    padding-left: 28px;
}

[data-theme="dark"] .faq-question:hover {
    background: rgba(255, 255, 255, 0.03);
}

.faq-item.active .faq-question {
    color: var(--tty-primary);
    background: transparent;
}

[data-theme="dark"] .faq-item.active .faq-question {
    color: var(--tty-primary-light);
}

/* FAQ Toggle Icon - Modern Animation */
.faq-toggle {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 16px;
    background: var(--tty-bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

[data-theme="dark"] .faq-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.faq-item.active .faq-toggle {
    background: var(--tty-primary);
    transform: rotate(180deg);
}

[data-theme="dark"] .faq-item.active .faq-toggle {
    background: var(--tty-primary-light);
}

.faq-toggle::before,
.faq-toggle::after {
    content: '';
    position: absolute;
    background: var(--tty-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .faq-toggle::before,
[data-theme="dark"] .faq-toggle::after {
    background: var(--tty-primary-light);
}

.faq-item.active .faq-toggle::before,
.faq-item.active .faq-toggle::after {
    background: white;
}

.faq-toggle::before {
    width: 2px;
    height: 14px;
    left: 13px;
    top: 7px;
}

.faq-toggle::after {
    width: 14px;
    height: 2px;
    left: 7px;
    top: 13px;
}

.faq-item.active .faq-toggle::before {
    transform: rotate(90deg);
    opacity: 0;
}

/* FAQ Answer - Enhanced Style */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    background: transparent;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 24px 24px;
    opacity: 1;
    overflow: scroll;
}

[data-theme="dark"] .faq-answer p {
    color: rgba(255, 255, 255, 0.8);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    padding-left: 24px;
    margin: 8px 0 16px 0;
}

.faq-answer ul {
    list-style-type: disc;
}

.faq-answer ol {
    list-style-type: decimal;
}

.faq-answer li {
    padding-left: 6px;
    margin-bottom: 6px;
    line-height: 1.6;
    color: var(--tty-text-primary);
}

[data-theme="dark"] .faq-answer li {
    color: rgba(255, 255, 255, 0.8);
}

.faq-answer ul ul,
.faq-answer ol ol,
.faq-answer ul ol,
.faq-answer ol ul {
    margin: 4px 0 4px 0;
}


[data-theme="dark"] .reference-content,
[data-theme="dark"] .info-content {
    background: rgba(0, 95, 95, 0.1);
    border-left-color: var(--tty-primary-light);
}

.info-field strong,
.source-reference strong {
    margin: 16px 0 8px 0;
    display: block;
    color: var(--tty-primary);
    font-size: 14px;
    font-weight: 600;
}

[data-theme="dark"] .info-field strong,
[data-theme="dark"] .source-reference strong {
    color: var(--tty-primary-light);
}

.source-reference {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 95, 95, 0.1);
}

[data-theme="dark"] .source-reference {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Dashicons PDF Style */
.dashicons.dashicons-pdf {
    color: var(--tty-secondary);
    font-size: 24px;
    width: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

[data-theme="dark"] .dashicons.dashicons-pdf {
    color: var(--tty-secondary-light);
}

/* Checked Info Styling */
.checked-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.checked-info strong {
    min-width: 150px;
    color: var(--tty-text-secondary);
    font-weight: 600;
}

[data-theme="dark"] .checked-info strong {
    color: rgba(255, 255, 255, 0.7);
}

.last-update,
.creation-date,
.checked-by {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Filter Animation States */
.faq-item.filtered-out {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Screen Reader Support */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Loading State */
.faq-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--tty-text-secondary);
}

.faq-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--tty-border-light);
    border-top-color: var(--tty-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.faq-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--tty-text-secondary);
    background: rgba(0, 95, 95, 0.03);
    border-radius: 16px;
    border: 1px dashed var(--tty-border-light);
}

[data-theme="dark"] .faq-empty {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
}

.faq-empty-icon {
    font-size: 48px;
    color: var(--tty-primary);
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .faq-filter-area {
        margin-bottom: 24px;
    }
    
    .faq-filter-button {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .faq-scroll-arrow {
        width: 36px;
        height: 36px;
    }
    
    .faq-scroll-left {
        left: -18px;
    }
    
    .faq-scroll-right {
        right: -18px;
    }
    
    .faq-header {
        font-size: 20px;
        padding: 16px 0 12px 0;
        margin-top: -15px;
        margin-bottom: 20px;
    }
    
    .faq-item {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .faq-question {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 20px 20px 20px;
    }
    
    .faq-answer p {
        font-size: 14px;
    }
    
    .popup-content .close-popup {
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        border-radius: 12px !important;
        transition: all 0.15s ease !important;
        color: var(--tty-primary);
    }

}

@media (max-width: 480px) {
    .faq-filter-container {
        gap: 8px;
    }
    
    .faq-filter-button {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    .faq-header {
        font-size: 18px;
    }
    
    .faq-question {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .faq-question:hover {
        padding-left: 20px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-answer,
    .faq-toggle,
    .faq-toggle::before,
    .faq-toggle::after,
    .faq-filter-button,
    .faq-scroll-arrow {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .faq-filter-area,
    .faq-scroll-arrow {
        display: none !important;
    }
    
    .faq-item {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .faq-item.active .faq-answer {
        max-height: none !important;
        display: block !important;
    }
    
    .faq-toggle {
        display: none !important;
    }
}