/* ============================================================
   Creet FAQ — Admin + Frontend Styles
   Design System: dark gradient headers, store-design color vars, RTL
   ============================================================ */

/* ── Admin wrap ─────────────────────────────────────────── */
.creet-faq-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    padding-bottom: 40px;
}

.creet-faq-header {
    background: linear-gradient(135deg, #000, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.creet-faq-header h1 {
    color: #C3FD73;
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    padding: 0;
}
.creet-faq-header p {
    color: rgba(255,255,255,.55);
    margin: 4px 0 0;
    font-size: 13px;
}

.creet-faq-hint {
    background: #f0fdf4;
    border: 1.5px solid #C3FD73;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 8px;
}
.creet-faq-hint code {
    background: #dcfce7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.creet-faq-btn-primary {
    background: #C3FD73;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .2s;
}
.creet-faq-btn-primary:hover { opacity: .85; }

.creet-faq-btn-ghost {
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.creet-faq-btn-ghost:hover { border-color: #94a3b8; color: #334155; }

.creet-faq-form-card {
    background: #fff;
    border: 2px solid #C3FD73;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}
.creet-faq-form-card h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px;
}
.creet-faq-form-row {
    margin-bottom: 16px;
}
.creet-faq-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.creet-faq-form-row textarea,
.creet-faq-form-row input[type="text"],
.creet-faq-form-row select {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    direction: rtl;
    transition: border-color .2s;
}
.creet-faq-form-row textarea:focus,
.creet-faq-form-row input[type="text"]:focus,
.creet-faq-form-row select:focus {
    border-color: #C3FD73;
    outline: none;
    background: #fff;
}
.creet-faq-form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.creet-faq-form-row.two-col label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.creet-faq-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.creet-faq-list-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}
.creet-faq-table-header {
    display: grid;
    grid-template-columns: 28px 1fr 120px 90px 160px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: #0f172a;
    color: #C3FD73;
    font-size: 12px;
    font-weight: 700;
}
.creet-faq-sortable { list-style: none; margin: 0; padding: 0; }
.creet-faq-item {
    display: grid;
    grid-template-columns: 28px 1fr 120px 90px 160px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.creet-faq-item:last-child { border-bottom: none; }
.creet-faq-item:hover { background: #fafafa; }
.creet-faq-item.ui-sortable-helper {
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 8px;
}
.creet-faq-drag-handle { color: #cbd5e1; cursor: grab; display: flex; align-items: center; }
.creet-faq-drag-handle:active { cursor: grabbing; }
.creet-faq-item-content { min-width: 0; }
.creet-faq-item-q {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.creet-faq-item-a {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.creet-faq-item-cat { font-size: 12px; color: #64748b; }
.creet-faq-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.badge-published { background: #f0fdf4; color: #16a34a; }
.badge-draft     { background: #fef9c3; color: #854d0e; }
.creet-faq-item-actions { display: flex; gap: 6px; }
.creet-faq-btn-edit,
.creet-faq-btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    transition: all .2s;
}
.creet-faq-btn-edit { background: #fff; color: #0f172a; border-color: #e2e8f0; }
.creet-faq-btn-edit:hover { border-color: #C3FD73; background: #f0fdf4; }
.creet-faq-btn-delete { background: #fff; color: #dc2626; border-color: #fecaca; }
.creet-faq-btn-delete:hover { background: #fef2f2; border-color: #dc2626; }
.creet-faq-empty { text-align: center; padding: 48px 24px; color: #94a3b8; }
.creet-faq-empty svg { display: block; margin: 0 auto 12px; }
.creet-faq-empty p { font-size: 14px; }

.creet-faq-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #0f172a;
    color: #C3FD73;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    border: 2px solid #C3FD73;
}
.creet-faq-toast.error { border-color: #dc2626; color: #dc2626; }


/* ══════════════════════════════════════════════════════════
   FRONTEND — FAQ Accordion
   Colors pulled from --creet-secondary-color which is set on
   :root by creet-store-design plugin (store manager's choice).
   All rules use !important to beat Blocksy theme overrides.
   ══════════════════════════════════════════════════════════ */

.creet-faq-accordion {
    max-width: 820px !important;
    margin: 0 auto !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif !important;
    direction: rtl !important;
}

/* Section wrapper */
.creet-faq-section {
    margin-bottom: 56px !important;
}
.creet-faq-section:last-child { margin-bottom: 0 !important; }

/* Category heading */
.creet-faq-category-title {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 28px !important;
    padding-bottom: 14px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
}
.creet-faq-cat-accent {
    display: inline-block !important;
    width: 5px !important;
    height: 24px !important;
    border-radius: 3px !important;
    background: var(--creet-secondary-color, #f9a825) !important;
    flex-shrink: 0 !important;
}

/* Individual item */
.creet-faq-ac-item {
    background: #fff !important;
    border: 1.5px solid #e2e8f2 !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
    overflow: hidden !important;
    transition: border-color .25s, box-shadow .25s !important;
    box-shadow: none !important;
}
.creet-faq-ac-item:last-child { margin-bottom: 0 !important; }
.creet-faq-ac-item:hover {
    border-color: var(--creet-secondary-color, #f9a825) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.06) !important;
}
.creet-faq-ac-item.is-open {
    border-color: var(--creet-secondary-color, #f9a825) !important;
    box-shadow: 0 6px 24px rgba(0,0,0,.08) !important;
}

/* Question button */
.creet-faq-ac-question {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 26px 28px !important;
    text-align: right !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    transition: background .2s !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
}
.creet-faq-ac-question:hover {
    background: rgba(0,0,0,.02) !important;
}
.creet-faq-ac-item.is-open .creet-faq-ac-question {
    background: rgba(0,0,0,.03) !important;
}

/* Number badge */
.creet-faq-q-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
    transition: background .25s, color .25s !important;
}
.creet-faq-ac-item.is-open .creet-faq-q-number {
    background: var(--creet-secondary-color, #f9a825) !important;
    color: #fff !important;
}

/* Question text */
.creet-faq-q-text {
    flex: 1 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    text-align: right !important;
    line-height: 1.55 !important;
}

/* Chevron — neutral dark, no store color bleed */
.creet-faq-ac-icon {
    flex-shrink: 0 !important;
    color: #94a3b8 !important;
    transition: transform .3s cubic-bezier(.4,0,.2,1), color .25s !important;
    display: flex !important;
    opacity: 1 !important;
}
.creet-faq-ac-item.is-open .creet-faq-ac-icon {
    transform: rotate(180deg) !important;
    color: var(--creet-secondary-color, #f9a825) !important;
}

/* ── Answer panel ─────────────────────────────────────── */
.creet-faq-ac-answer {
    overflow: hidden !important;
}
.creet-faq-ac-answer-inner {
    /* Large top padding = big visual gap between question and answer */
    padding: 36px 28px 36px 28px !important;
    padding-right: 78px !important; /* indent to align past number badge */
    font-size: 15px !important;
    line-height: 1.9 !important;
    color: #475569 !important;
    border-top: 1px solid #eef2f7 !important;
    border-right: 5px solid var(--creet-secondary-color, #f9a825) !important;
    border-left: none !important;
    border-bottom: none !important;
    background: #fafbfc !important;
}

.creet-faq-no-results {
    color: #94a3b8 !important;
    text-align: center !important;
    padding: 40px !important;
    font-size: 15px !important;
}

/* Mobile */
@media (max-width: 600px) {
    .creet-faq-ac-question { padding: 20px 18px !important; gap: 12px !important; }
    .creet-faq-q-text { font-size: 14px !important; }
    .creet-faq-ac-answer-inner {
        padding: 28px 18px 28px 18px !important;
        border-right: none !important;
        border-top: 4px solid var(--creet-secondary-color, #f9a825) !important;
    }
    .creet-faq-category-title { font-size: 15px !important; }
    .creet-faq-q-number { width: 28px !important; height: 28px !important; min-width: 28px !important; font-size: 12px !important; }
}
