/* app/static/css/qna.css */
/* Q&A (Questions and Answers) Section Styling */

:root {
    --primary-color: #007533;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --light-bg: #f8f8f8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Q&A SECTION
   ======================================== */

.product-qna {
    margin: 40px auto;
    max-width: 1400px;
    padding: 0 20px;
}

.product-qna h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.qna-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Q&A ITEM (Accordion Style)
   ======================================== */

.qna-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.qna-item:hover {
    box-shadow: var(--shadow-md);
}

.qna-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    background-color: var(--card-bg);
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
    gap: 16px;
}

.qna-question:hover {
    background-color: var(--light-bg);
}

.qna-question.active {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.qna-question-text {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qna-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.qna-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--light-bg);
    color: var(--primary-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.qna-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.qna-question.active .qna-toggle {
    background-color: var(--primary-color);
    color: white;
}

.qna-question.active .qna-toggle svg {
    transform: rotate(180deg);
}

.qna-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 24px;
}

.qna-answer.active {
    max-height: 1000px;
    padding: 20px 24px 24px 24px;
}

.qna-answer-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

.qna-answer-content p {
    margin-bottom: 12px;
}

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

.qna-answer-content ul,
.qna-answer-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.qna-answer-content li {
    margin-bottom: 8px;
}

.qna-answer-content strong,
.qna-answer-content b {
    font-weight: 600;
    color: var(--text-color);
}

.qna-answer-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.qna-answer-content a:hover {
    color: #006a33;
}

/* Empty State */
.qna-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
    font-style: italic;
}

/* ========================================
   RESPONSIVE - Tablet
   ======================================== */

@media (max-width: 992px) {
    .product-qna h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .qna-question {
        padding: 18px 20px;
    }
    
    .qna-question-text {
        font-size: 15px;
    }
    
    .qna-icon {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }
    
    .qna-answer.active {
        padding: 18px 20px 20px 20px;
    }
}

/* ========================================
   RESPONSIVE - Mobile
   ======================================== */

@media (max-width: 768px) {
    .product-qna {
        margin: 30px 0;
        padding: 0 15px;
    }
    
    .product-qna h2 {
        font-size: 20px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .qna-list {
        gap: 16px;
    }
    
    .qna-question {
        padding: 16px;
        gap: 12px;
    }
    
    .qna-question-text {
        font-size: 14px;
    }
    
    .qna-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .qna-toggle {
        width: 28px;
        height: 28px;
    }
    
    .qna-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    .qna-answer {
        padding: 0 16px;
    }
    
    .qna-answer.active {
        padding: 16px;
    }
    
    .qna-answer-content {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* ========================================
   RESPONSIVE - Small Mobile
   ======================================== */

@media (max-width: 576px) {
    .product-qna h2 {
        font-size: 18px;
    }
    
    .qna-question {
        padding: 14px;
    }
    
    .qna-question-text {
        font-size: 13px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus styles for keyboard navigation */
.qna-question:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .qna-answer,
    .qna-toggle svg,
    .qna-item {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .qna-item {
        border-width: 2px;
    }
    
    .qna-icon {
        border: 2px solid currentColor;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .product-qna {
        page-break-inside: avoid;
    }
    
    .qna-question {
        cursor: default;
    }
    
    .qna-toggle {
        display: none;
    }
    
    .qna-answer {
        max-height: none !important;
        padding: 12px 0 !important;
        display: block !important;
    }
    
    .qna-question.active {
        border-bottom: 1px solid var(--border-color);
    }
}