/* ============================================================
   NPD Social Login — Frontend Styles
   v1.0.0
============================================================ */

/* ── Wrapper ──────────────────────────────────────────────── */
.npd-sl-wrapper,
.npd-sl-um-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Divider ──────────────────────────────────────────────── */
.npd-sl-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.npd-sl-divider::before,
.npd-sl-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}
.npd-sl-divider span {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── Button Grid ─────────────────────────────────────────── */
.npd-sl-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* icon_text: show label, fit in 2 columns */
.npd-sl-style-icon_text .npd-sl-btn {
    justify-content: flex-start;
    padding: 10px 14px;
}

/* icon_only: smaller square buttons */
.npd-sl-style-icon_only .npd-sl-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
}
.npd-sl-style-icon_only .npd-sl-btn-label { display: none; }
.npd-sl-style-icon_only .npd-sl-buttons {
    grid-template-columns: repeat(auto-fill, 48px);
}

/* text_only: full-width rows */
.npd-sl-style-text_only .npd-sl-buttons {
    grid-template-columns: 1fr;
}
.npd-sl-style-text_only .npd-sl-btn-icon { display: none; }

/* ── Button Base ─────────────────────────────────────────── */
.npd-sl-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    text-align: left;
    width: 100%;
    line-height: 1;
    position: relative;
    overflow: hidden;
}
.npd-sl-btn:hover {
    background: #f9f9f9;
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.npd-sl-btn:active {
    transform: translateY(0);
    box-shadow: none;
}
.npd-sl-btn:focus {
    outline: 2px solid var(--npd-provider-color, #4285f4);
    outline-offset: 2px;
}
.npd-sl-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}
.npd-sl-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.npd-sl-btn-icon svg {
    display: block;
}
.npd-sl-btn-label {
    flex: 1;
    color: #fff;
}

/* ── Spinner ─────────────────────────────────────────────── */
.npd-sl-btn.loading .npd-sl-btn-icon::after {
    content: '';
    display: block;
    width: 16px; height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--npd-provider-color, #333);
    border-radius: 50%;
    animation: npd-sl-spin 0.65s linear infinite;
}
.npd-sl-btn.loading .npd-sl-btn-icon svg { display: none; }
@keyframes npd-sl-spin { to { transform: rotate(360deg); } }

/* ── Dark mode support ───────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .npd-sl-btn {
        background: #1a1a1a;
        border-color: #333;
        color: #f0f0f0;
    }
    .npd-sl-btn:hover {
        background: #222;
        border-color: #555;
    }
    .npd-sl-divider::before,
    .npd-sl-divider::after { background: #333; }
    .npd-sl-divider span { color: #777; }
}

/* ── Ultimate Member overrides ──────────────────────────── */
.um-form .npd-sl-wrapper,
.um-form .npd-sl-um-wrapper {
    padding: 0 20px 16px;
}

/* ── Profile Tab ────────────────────────────────────────── */
.npd-sl-profile-tab h3 {
    margin: 0 0 16px;
    font-size: 16px;
}
.npd-sl-connected-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.npd-sl-connected-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}
.npd-sl-connected-item.connected {
    border-color: #4caf50;
    background: #f9fff9;
}
.npd-sl-item-icon { display: flex; width: 22px; flex-shrink: 0; }
.npd-sl-item-name { flex: 1; font-weight: 500; }
.npd-sl-item-status { font-size: 12px; color: #888; }
.npd-sl-connected-item.connected .npd-sl-item-status { color: #4caf50; }

/* ── Notice ─────────────────────────────────────────────── */
.npd-sl-notice {
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    font-size: 13px;
    color: #555;
}
