/**
 * MarketLyft Sync — Admin Settings Styles
 *
 * Scoped to .mlwps-settings to avoid conflicts with other plugins.
 */

/* ------------------------------------------------------------------ */
/*  Settings page layout                                              */
/* ------------------------------------------------------------------ */

.mlwps-settings h1 {
    font-size: 1.6em;
    margin-bottom: 0.5em;
}

.mlwps-settings h2 {
    font-size: 1.2em;
    border-bottom: 1px solid #ccd0d4;
    padding-bottom: 0.4em;
    margin-top: 1.5em;
}

/* ------------------------------------------------------------------ */
/*  Field mapping table                                               */
/* ------------------------------------------------------------------ */

.mlwps-field-map {
    margin-top: 1em;
    max-width: 700px;
}

.mlwps-field-map thead th {
    font-weight: 600;
    padding: 8px 10px;
}

.mlwps-field-map tbody td {
    padding: 4px 10px;
    vertical-align: middle;
}

.mlwps-field-map input.regular-text {
    width: 100%;
    max-width: 260px;
}

.mlwps-field-map tfoot td {
    padding: 10px;
}

.mlwps-remove-row {
    color: #a00 !important;
    border-color: #a00 !important;
    min-width: 32px;
}

.mlwps-remove-row:hover {
    background: #a00 !important;
    color: #fff !important;
}

/* ------------------------------------------------------------------ */
/*  Connection test                                                   */
/* ------------------------------------------------------------------ */

#mlwps-test-connection {
    margin-right: 10px;
}

#mlwps-test-result {
    font-weight: 600;
}

#mlwps-test-result.success {
    color: #46b450;
}

#mlwps-test-result.error {
    color: #dc3232;
}

/* ------------------------------------------------------------------ */
/*  Checkbox groups                                                   */
/* ------------------------------------------------------------------ */

.mlwps-settings label {
    display: inline-block;
    margin-bottom: 4px;
}

/* ------------------------------------------------------------------ */
/*  OAuth2 status                                                     */
/* ------------------------------------------------------------------ */

.mlwps-oauth-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
}

.mlwps-oauth-authorized {
    background: #ecf7ed;
    color: #2e7d32;
}

.mlwps-oauth-expired {
    background: #fff8e1;
    color: #f57f17;
}

.mlwps-oauth-not-authorized {
    background: #f5f5f5;
    color: #666;
}

/* ------------------------------------------------------------------ */
/*  First Sync                                                        */
/* ------------------------------------------------------------------ */

.mlwps-first-sync {
    max-width: 700px;
}

.mlwps-first-sync__summary {
    margin: 0.5em 0 1em 1.5em;
    list-style: disc;
}

.mlwps-first-sync__summary li {
    margin-bottom: 2px;
}

.mlwps-first-sync__total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #ccd0d4;
    list-style: none;
    margin-left: -1.5em;
}

.mlwps-first-sync__status {
    margin-left: 10px;
    font-weight: 600;
}

.mlwps-first-sync__status.success {
    color: #46b450;
}

.mlwps-first-sync__status.error {
    color: #dc3232;
}

.mlwps-first-sync__progress {
    margin-top: 12px;
}

.mlwps-first-sync__bar {
    width: 100%;
    background: #f0f0f1;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    height: 18px;
    overflow: hidden;
}

.mlwps-first-sync__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: #2271b1;
    transition: width 0.3s ease-out;
}

.mlwps-first-sync__progress-text {
    margin-top: 6px;
    font-size: 13px;
    color: #50575e;
}

.mlwps-first-sync__reset {
    font-size: 13px;
    color: #a00;
    text-decoration: none;
}

.mlwps-first-sync__reset:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  Welcome card (onboarding for new users)                           */
/* ------------------------------------------------------------------ */

.mlwps-welcome-card {
    margin: 1.5em 0 1em;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f0f6fc 0%, #f6f7f7 100%);
    border: 1px solid #c3d4e5;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    max-width: 1100px;
}

.mlwps-welcome-card__title {
    margin: 0 0 6px;
    font-size: 1.4em;
    font-weight: 600;
    color: #1d2327;
    border-bottom: none;
    padding-bottom: 0;
}

.mlwps-welcome-card__subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #50575e;
    max-width: 720px;
}

.mlwps-welcome-card__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.mlwps-welcome-step {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

.mlwps-welcome-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
}

.mlwps-welcome-step__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.mlwps-welcome-step__body {
    margin: 0 0 12px;
    font-size: 13px;
    color: #50575e;
    flex-grow: 1;
}

.mlwps-welcome-step__cta {
    align-self: flex-start;
}

.mlwps-welcome-card__footer {
    margin: 0;
    padding-top: 14px;
    border-top: 1px dashed #c3d4e5;
    font-size: 13px;
    color: #50575e;
}

.mlwps-welcome-card__footer a {
    font-weight: 600;
}

@media screen and (max-width: 782px) {
    .mlwps-welcome-card {
        padding: 18px 16px;
    }
    .mlwps-welcome-card__steps {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/*  Help / contact box (visible across all states)                    */
/* ------------------------------------------------------------------ */

.mlwps-help-box {
    margin: 1em 0;
    padding: 16px 20px;
    background: #fffbea;
    border: 1px solid #f0e1a0;
    border-left: 4px solid #dba617;
    border-radius: 4px;
    max-width: 1100px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.mlwps-help-box__icon {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
    margin-top: 2px;
}

.mlwps-help-box__content {
    flex: 1 1 auto;
}

.mlwps-help-box__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.mlwps-help-box__title .mlwps-badge-247 {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.mlwps-help-box__body {
    margin: 0;
    font-size: 13px;
    color: #50575e;
    line-height: 1.5;
}

.mlwps-help-box__body a {
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/*  FAQ                                                                */
/* ------------------------------------------------------------------ */

.mlwps-faq {
    margin: 1.5em 0;
    max-width: 1100px;
}

.mlwps-faq > summary {
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 0.8em;
    list-style: none;
}

.mlwps-faq > summary::-webkit-details-marker {
    display: none;
}

.mlwps-faq > summary::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 4px;
    transition: transform 0.15s ease-out;
}

.mlwps-faq[open] > summary::before {
    transform: rotate(90deg);
}

.mlwps-faq__item {
    margin: 0 0 14px;
    padding: 0;
}

.mlwps-faq__item dt {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
    font-size: 14px;
}

.mlwps-faq__item dd {
    margin: 0 0 0 0;
    color: #50575e;
    font-size: 13px;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/*  Collapsible advanced sections (progressive disclosure)            */
/* ------------------------------------------------------------------ */

.mlwps-collapsible {
    margin: 1.5em 0;
    max-width: 1100px;
}

.mlwps-collapsible > summary {
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 0.8em;
    list-style: none;
}

.mlwps-collapsible > summary::-webkit-details-marker {
    display: none;
}

.mlwps-collapsible > summary::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 4px;
    transition: transform 0.15s ease-out;
}

.mlwps-collapsible[open] > summary::before {
    transform: rotate(90deg);
}

.mlwps-collapsible > summary .mlwps-collapsible__hint {
    font-weight: 400;
    font-size: 13px;
    color: #646970;
    margin-left: 8px;
}
