/**
 * @author       Zbigniew Stanejko <info@prestashop.cc>
 * @copyright    © 2012-2025 Zbigniew Stanejko, PrestaPremium. All rights reserved.
 * @license      This program is not free software.
 * @file         ppfaq-front.css
 */

/* ============================================
   PPFAQ Frontend Styles
   ============================================ */

/* Main Container */
.ppfaq-product-section,
.ppfaq-page {
    padding: 20px 0;
}

.ppfaq-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* FAQ List - Accordion */
.ppfaq-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ppfaq-item {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ppfaq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ppfaq-question:hover {
    background: #e9ecef;
}

.ppfaq-question-text {
    font-weight: 600;
    color: #333;
    flex: 1;
    padding-right: 15px;
}

.ppfaq-toggle {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ppfaq-toggle:before,
.ppfaq-toggle:after {
    content: '';
    position: absolute;
    background: #666;
    transition: transform 0.3s ease;
}

.ppfaq-toggle:before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    margin-top: -1px;
}

.ppfaq-toggle:after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    margin-left: -1px;
}

.ppfaq-item.active .ppfaq-toggle:after {
    transform: rotate(90deg);
    opacity: 0;
}

.ppfaq-answer {
    display: none;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    color: #555;
    line-height: 1.6;
}

.ppfaq-item.active .ppfaq-answer {
    display: block;
}

.ppfaq-empty {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}

/* Page Tabs */
.ppfaq-tabs-wrapper {
    margin-bottom: 30px;
}

.ppfaq-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 -1px 0;
    border-bottom: 2px solid #e5e5e5;
}

.ppfaq-tab-item {
    margin-right: 5px;
}

.ppfaq-tab-item a {
    display: block;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ppfaq-tab-item:hover a,
.ppfaq-tab-item.active a {
    background: #fff;
    color: #2fb5d2;
    border-color: #2fb5d2;
}

.ppfaq-tab-item.active a {
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.ppfaq-tabs-content {
    border: 1px solid #e5e5e5;
    border-top: none;
    padding: 20px;
    background: #fff;
}

.ppfaq-tab-pane {
    display: none;
}

.ppfaq-tab-pane.active {
    display: block;
}

/* Ask Question Button */
.ppfaq-ask-section,
.ppfaq-ask-page-section {
    margin-top: 20px;
    text-align: center;
}

.ppfaq-ask-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: #2fb5d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ppfaq-ask-btn:hover {
    background: #249eb8;
}

/* Form Overlay (Modal) */
.ppfaq-form-overlay {
    display: block;
}

.ppfaq-form-overlay.hidden {
    display: none;
}

.ppfaq-form-overlay:not(.hidden) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ppfaq-form-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
}

.ppfaq-form-modal.hidden {
    display: none;
}

.ppfaq-form-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    line-height: .8;
    z-index: 10;
}

.ppfaq-form-close:hover {
    color: #333;
}

/* Form Styles */
.ppfaq-form {
    padding: 30px;
}

.ppfaq-form-header {
    margin-bottom: 15px;
}

.ppfaq-form-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.ppfaq-form-description {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.ppfaq-form .form-group {
    margin-bottom: 20px;
}

.ppfaq-form label {
    display: flex;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

/* Product Preview in Form */
.ppfaq-product-preview {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.ppfaq-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppfaq-product-title::before {
    content: "📦";
    font-size: 16px;
}

.ppfaq-product-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ppfaq-product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ppfaq-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ppfaq-product-details {
    flex: 1;
    min-width: 0;
}

.ppfaq-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.ppfaq-product-ref,
.ppfaq-product-attr,
.ppfaq-product-price {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    line-height: 1.2;
}

.ppfaq-product-ref strong,
.ppfaq-product-attr strong,
.ppfaq-product-price strong {
    color: #333;
    font-weight: 600;
}

.ppfaq-form label .required {
    color: #e74c3c;
}

.ppfaq-form .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ppfaq-form .form-control:focus {
    border-color: #2fb5d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.1);
}

.ppfaq-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
    padding: 12px;
}

/* GDPR Consents */
.ppfaq-gdpr-consents {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.ppfaq-gdpr-consents .gdpr-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppfaq-gdpr-consents .gdpr-title i {
    font-size: 18px;
    color: #2fb5d2;
}

.gdpr-consent-item {
    margin-bottom: 12px;
}

.gdpr-consent-item:last-child {
    margin-bottom: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.gdpr-checkbox {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.checkbox-label .required {
    color: #e74c3c;
    margin-left: 2px;
    font-weight: bold;
}

.ppfaq-gdpr-error {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 5px;
    padding-left: 28px;
}

/* Captcha Section */
.ppfaq-captcha {
    margin-top: 15px;
}

/* Messages */
.ppfaq-messages {

}

.ppfaq-success,
.ppfaq-error {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ppfaq-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ppfaq-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

/* Form Success State - Hide form fields after submission */
.ppfaq-form.ppfaq-form-success .form-group,
.ppfaq-form.ppfaq-form-success .gdpr_consent,
.ppfaq-form.ppfaq-form-success .ppfaq-gdpr-consents,
.ppfaq-form.ppfaq-form-success .ppfaq-form-footer button {
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

#ppfaq-ask-form .psgdpr_consent_message input[type="checkbox"]+span {
  min-width: 19px;
  height: 19px;
  width: 19px;
}

/* Submit Button */
.ppfaq-form-footer {
    margin-top: 20px;
}

.ppfaq-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: #2fb5d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ppfaq-submit-btn:hover {
    background: #249eb8;
}

.ppfaq-submit-btn:disabled,
.ppfaq-submit-btn.disabled {
    background: #bbb !important;
    color: #777 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.ppfaq-btn-loading {
    display: inline-block;
}

/* Page Header */
.ppfaq-page-header {
    margin-bottom: 20px;
}

.ppfaq-page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.ppfaq-page-description {
    margin-bottom: 30px;
    color: #666;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .ppfaq-tabs-nav {
        flex-direction: column;
    }
    
    .ppfaq-tab-item {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .ppfaq-tab-item a {
        border-radius: 4px;
        border: 1px solid #e5e5e5;
    }
    
    .ppfaq-tabs-content {
        border-radius: 4px;
        border: 1px solid #e5e5e5;
    }
    
    .ppfaq-question {
        padding: 12px 15px;
    }
    
    .ppfaq-answer {
        padding: 15px;
    }
    
    .ppfaq-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ppfaq-form-modal {
        border-radius: 0;
        max-height: 100vh;
    }
}
