/**
 * Medicabazaar - Premium Questions and Answers Stylesheet
 */

:root {
    --qa-blue-bg: #EFF6FF;
    --qa-blue-text: #1D4ED8;
    --qa-blue-border: #BFDBFE;

    /* Q&A HSL Tailored Colors */
    --pending-bg: #FFFBEB;
    --pending-text: #B45309;
    --pending-border: #FDE68A;

    --answered-bg: #F0FDF4;
    --answered-text: #15803D;
    --answered-border: #BBF7D0;
}

/* ==========================================================================
   1. PRODUCT DETAILS - Q&A WRAPPERS
   ========================================================================== */

.qa-section-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #334155;
}

.qa-slider-outer {
    position: relative;
    width: 100%;
}

.qa-list-wrapper.qa-list-slider {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 8px 4px 16px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.qa-list-wrapper.qa-list-slider::-webkit-scrollbar {
    display: none;
}

/* Slider Nav Buttons */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #334155;
    font-size: 1rem;
}

.slider-nav-btn.prev-btn {
    left: -20px;
}

.slider-nav-btn.next-btn {
    right: -20px;
    color: #f97316;
}

.slider-nav-btn:hover {
    background: #FFFFFF;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.slider-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.slider-nav-btn.is-disabled,
.slider-nav-btn:disabled {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

@media (max-width: 768px) {
    .slider-nav-btn.prev-btn {
        left: -8px;
    }
    .slider-nav-btn.next-btn {
        right: -8px;
    }
}

/* QA Card Item */
.qa-card-item {
    flex: 0 0 380px;
    width: 380px;
    max-width: 88vw;
    scroll-snap-align: start;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}

.qa-card-item:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: #CBD5E1;
}

.qa-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.35;
    word-break: break-word;
    margin-bottom: 2px;
}

.qa-card-meta {
    font-size: 0.82rem;
    color: #64748B;
    font-weight: 400;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.verified-purchase-tag {
    color: #00A859;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F0FDF4;
    border: 1px solid #DCFCE7;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Seller Reply Bubble */
.seller-reply-bubble {
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: auto;
}

.seller-reply-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.seller-reply-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.seller-reply-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.seller-reply-logo span {
    font-weight: 700;
    font-size: 0.85rem;
    color: #475569;
}

.seller-reply-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.seller-reply-author {
    font-size: 0.84rem;
    font-weight: 400;
    color: #1E293B;
    line-height: 1.25;
}

.seller-reply-author strong {
    font-weight: 700;
    color: #0F172A;
}

.seller-reply-time {
    font-size: 0.72rem;
    color: #94A3B8;
    font-weight: 400;
}

.seller-reply-body {
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.55;
    word-break: break-word;
}

.read-more-toggle {
    font-weight: 700;
    color: #0F172A;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    transition: color 0.15s ease;
}

.read-more-toggle:hover {
    color: #0D47A1;
    text-decoration: underline;
}

/* ==========================================================================
   2. QUESTIONS I ASKED (ACCOUNT PANEL)
   ========================================================================== */

.buyer-qa-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.buyer-qa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    border-color: #CBD5E1;
}

.buyer-qa-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.buyer-qa-product-side {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-right: 1px solid #F1F5F9;
    padding-right: 20px;
}

.buyer-qa-content-side {
    display: flex;
    flex-direction: column;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 9999px;
    border: 1px solid;
    width: fit-content;
}

.badge-status.pending {
    background-color: var(--pending-bg);
    color: var(--pending-text);
    border-color: var(--pending-border);
}

.badge-status.answered {
    background-color: var(--answered-bg);
    color: var(--answered-text);
    border-color: var(--answered-border);
}

@media (max-width: 991px) {
    .buyer-qa-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .buyer-qa-product-side {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #F1F5F9;
        padding-bottom: 15px;
    }
    .qa-answer-bubble {
        margin-left: 0;
    }
}

/* ==========================================================================
   3. FORM ELEMENTS & SWITCHES
   ========================================================================== */

.qa-form {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 28px;
}

.qa-textarea {
    border-radius: 12px;
    border: 1px solid #CBD5E1;
    padding: 14px;
    font-size: 0.9rem;
    resize: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qa-textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.02);
    outline: none;
}

/* Switch Styles */
.form-switch-premium .form-check-input {
    width: 2.8em;
    height: 1.5em;
    cursor: pointer;
    background-size: contain;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* ==========================================================================
   4. SKELETON LOADERS
   ========================================================================== */

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.placeholder-glow .placeholder {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.skeleton-qa {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 24px;
}

/* ==========================================================================
   5. DYNAMIC CIRCULAR CHECKBOX & CONSENT BOX
   ========================================================================== */

.qa-public-consent-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFDF4; /* subtle golden background for warning/consent alignment */
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.qa-public-consent-box:hover {
    background: #FFFBEB;
    border-color: #FCD34D;
}

.qa-public-consent-box .form-check-input {
    border-radius: 50% !important; /* Circular shape */
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    border: 2px solid #D1D5DB;
    transition: all 0.2s ease;
}

.qa-public-consent-box .form-check-input:checked {
    background-color: var(--primary-blue, #2563EB);
    border-color: var(--primary-blue, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.qa-public-consent-box .form-check-label {
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #514217;
    font-weight: 500;
    user-select: none;
}
