/**
 * WPFAQBlock – Settings Page Styles
 *
 * Premium styles for the Plugin Settings admin page.
 * Uses the same design tokens as admin-builder.css.
 *
 * @package WPFAQBlock
 * @since   2.0.0
 */

/* ─────────────────────────────────────────────
   Settings Page Shell
───────────────────────────────────────────── */
.faqb-settings-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #374151;
    background: #F9FAFB;
    min-height: 100vh;
}

/* ─────────────────────────────────────────────
   Settings Layout Wrapper
───────────────────────────────────────────── */
.faqb-settings-layout {
    padding: 32px 24px;
    max-width: 820px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Page Header
───────────────────────────────────────────── */
.faqb-settings-header {
    margin-bottom: 32px;
}

.faqb-settings-header__title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.faqb-settings-header__subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Settings Card
───────────────────────────────────────────── */
.faqb-settings-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 24px;
}

/* ─────────────────────────────────────────────
   Card Section Header (replaces WP Settings API h2/h3)
───────────────────────────────────────────── */
.faqb-settings-card .faqb-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 28px;
    border-bottom: 1px solid #F3F4F6;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%);
}

.faqb-section-head__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FE8512 0%, #ff5f00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(254, 133, 18, 0.35);
}

/* Dashicons: line-height MUST equal font-size for vertical centering */
.faqb-section-head__icon .dashicons {
    color: #fff !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

.faqb-section-head__text h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 3px;
    line-height: 1.3;
}

.faqb-section-head__text p {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────
   WP Settings API overrides (table layout → modern)
───────────────────────────────────────────── */

/* Hide the auto-generated section h2 — we render our own icon header */
.faqb-settings-card form h2,
.faqb-settings-card > form > h2,
.faqb-settings-card form > h2 {
    display: none !important;
}

.faqb-settings-card .form-table {
    margin: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.faqb-settings-card .form-table tbody {
    display: block !important;
    margin: 0 !important;
}

.faqb-settings-card .form-table tr {
    display: flex;
    flex-direction: column;
    padding: 24px 28px !important;
    border-bottom: 1px solid #F3F4F6;
    width: auto !important;
    transition: background 0.15s ease;
}

.faqb-settings-card .form-table tr:last-child {
    border-bottom: none;
}

.faqb-settings-card .form-table tr:hover {
    background: #FAFAFA;
}

.faqb-settings-card .form-table th {
    display: block !important;
    width: auto !important;
    padding: 0 0 8px 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.7px !important;
    color: #6B7280 !important;
    text-align: left !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.faqb-settings-card .form-table td {
    display: block !important;
    padding: 0 !important;
    width: auto !important;
}

/* ─────────────────────────────────────────────
   Input Fields (password/text overrides)
───────────────────────────────────────────── */
.faqb-settings-card .form-table td input[type="password"],
.faqb-settings-card .form-table td input[type="text"],
.faqb-settings-card .form-table td input.regular-text {
    width: 100% !important;
    max-width: 100% !important;
    padding: 11px 14px 11px 42px !important;
    border: 1.5px solid #D1D5DB !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 1px !important;
    color: #111827 !important;
    background: #F9FAFB !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    outline: none !important;
    height: auto !important;
    line-height: 1.5 !important;
}

.faqb-settings-card .form-table td input[type="password"]:focus,
.faqb-settings-card .form-table td input[type="text"]:focus,
.faqb-settings-card .form-table td input.regular-text:focus {
    border-color: #FE8512 !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(254, 133, 18, 0.15) !important;
}

/* ─────────────────────────────────────────────
   Input Wrapper (for icon prefix)
───────────────────────────────────────────── */
.faqb-input-wrap {
    position: relative;
    display: block;
}

.faqb-input-wrap__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.faqb-input-wrap:focus-within .faqb-input-wrap__icon {
    color: #FE8512;
}

/* ─────────────────────────────────────────────
   Checkbox Fields
───────────────────────────────────────────── */
.faqb-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.faqb-checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    border-color: #D1D5DB;
    border-radius: 4px;
    box-shadow: none;
}

.faqb-checkbox-field input[type="checkbox"]:checked {
    background-color: #FE8512;
    border-color: #FE8512;
}

/* ─────────────────────────────────────────────
   Description / Helper Text
───────────────────────────────────────────── */
.faqb-settings-card .form-table td .description {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 9px !important;
    font-size: 12.5px !important;
    color: #6B7280 !important;
    line-height: 1.4 !important;
}

.faqb-settings-card .form-table td .description a {
    color: #FE8512 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.faqb-settings-card .form-table td .description a:hover {
    color: #E67600 !important;
    text-decoration: underline !important;
}

/* ─────────────────────────────────────────────
   Settings API: Section Title (h2) override
───────────────────────────────────────────── */
.faqb-settings-card > h2,
.faqb-settings-card > form > h2 {
    display: none !important;
}

/* ─────────────────────────────────────────────
   Footer / Submit Bar
───────────────────────────────────────────── */
.faqb-settings-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 28px;
    border-top: 1px solid #F3F4F6;
    background: #FAFAFA;
    gap: 12px;
}

/* ─────────────────────────────────────────────
   Submit Button Override
───────────────────────────────────────────── */
.faqb-settings-card input[type="submit"],
.faqb-settings-card .button.faqb-btn--primary,
input#submit.faqb-btn--primary,
input#submit.faqb-btn.faqb-btn--primary {
    background: linear-gradient(135deg, #FE8512 0%, #ff5f00 100%) !important;
    border-color: #FE8512 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 11px 28px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    text-shadow: none !important;
    box-shadow: 0 4px 12px rgba(254, 133, 18, 0.35) !important;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease !important;
    height: auto !important;
    line-height: 1.5 !important;
    letter-spacing: 0.2px !important;
}

.faqb-settings-card input[type="submit"]:hover,
.faqb-settings-card .button.faqb-btn--primary:hover,
input#submit.faqb-btn--primary:hover,
input#submit.faqb-btn.faqb-btn--primary:hover {
    background: linear-gradient(135deg, #E67600 0%, #d94f00 100%) !important;
    box-shadow: 0 6px 16px rgba(254, 133, 18, 0.45) !important;
    transform: translateY(-1px) !important;
    border-color: #E67600 !important;
    color: #fff !important;
}

.faqb-settings-card input[type="submit"]:active,
.faqb-settings-card .button.faqb-btn--primary:active,
input#submit.faqb-btn--primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(254, 133, 18, 0.3) !important;
}

.faqb-settings-card input[type="submit"]:focus,
input#submit.faqb-btn--primary:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(254, 133, 18, 0.35) !important;
}

/* ─────────────────────────────────────────────
   WP Admin Notice overrides
───────────────────────────────────────────── */
.faqb-settings-page .notice {
    border-radius: 8px;
    border-left-width: 4px;
    margin: 0 0 20px;
    padding: 12px 16px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.faqb-settings-page .notice-success {
    border-left-color: #10B981;
    background: #f0fdf4;
}

.faqb-settings-page .notice-error {
    border-left-color: #EF4444;
    background: #fef2f2;
}

/* ─────────────────────────────────────────────
   Topbar (shared with builder page)
───────────────────────────────────────────── */
.faqb-settings-page .faqb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 24px;
    gap: 16px;
    position: sticky;
    top: 32px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.faqb-settings-page .faqb-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.faqb-settings-page .faqb-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ensure "Back to Dashboard" button looks right */
.faqb-settings-page .faqb-btn--outline {
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    line-height: 1.4;
}

.faqb-settings-page .faqb-btn--outline:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #111827;
}

.faqb-settings-page .faqb-btn--sm {
    padding: 5px 11px;
    font-size: 12px;
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 782px) {
    .faqb-settings-layout {
        padding: 16px 12px;
    }

    .faqb-settings-card .form-table tr {
        padding: 18px 18px !important;
    }

    .faqb-settings-footer {
        padding: 18px 18px;
    }

    .faqb-section-head {
        padding: 16px 18px;
    }
}

/* ─────────────────────────────────────────────
   Legacy class support (wpfaqblock-admin-setting.css)
───────────────────────────────────────────── */
.wpfaqblock-container .tabcontent {
    background: #fff;
    padding: 30px;
    overflow: hidden;
    min-height: 500px;
    margin-right: 20px;
}

.submit-box .button.button-primary {
    background: #FE8512;
    border-color: #FE8512;
    box-shadow: none;
    padding: 4px 5px;
    min-width: 140px;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
    display: inline-block;
    line-height: 2;
    min-height: 28px;
    margin: 0;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    -webkit-appearance: none;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
}
