@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&display=swap');

* { box-sizing: border-box; }

/* Namespaced profile widget styles (pw- prefix) */
body .pw-logout-btn { display: none; }

.pw-widget {
    /* background opacity controlled by --pw-widget-opacity (0..1) */
    background-color: rgba(26,26,26,var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)));
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 380px;
    /* border and shadow also respect opacity so at 0 they become invisible */
    border: 1px solid rgba(255,255,255, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.06));
    box-shadow: 0 6px 18px rgba(0, 0, 0, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.65));
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.pw-avatar-section { position: relative; flex-shrink: 0; }
.pw-avatar { width: 48px; height: 48px; border-radius: 50%; display: block; }
.pw-status-dot { position: absolute; bottom: -1px; right: -1px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #1a1a1a; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.pw-status-icon { width:100%; height:100%; object-fit:cover; }

.pw-user-info { flex:1; min-width:0; }
.pw-username-line { display:flex; align-items:center; gap:8px; margin-bottom:3px; flex-wrap:nowrap; min-width:0; }
.pw-username { color:#ffffff; font-size:14px; font-weight:700; letter-spacing:-0.2px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex: 0 0 auto; }

.pw-activity-tag { background:#5865f2; color:#fff; font-size:10px; font-weight:700; padding:3px 6px 3px 4px; border-radius:4px; display:flex; align-items:center; gap:4px; text-transform:uppercase; letter-spacing:0.3px; }
.pw-tag-icon { width:12px; height:12px; border-radius:3px; object-fit:cover; flex-shrink:0; }

.pw-badge-row { display:flex; gap:6px; flex-wrap:nowrap; align-items:center; margin-left: 1px; flex: 0 0 auto; }
.pw-badge-img { width:14px; height:14px; display:block; }

.pw-activity-label { color:#b5bac1; font-size:10px; font-weight:600; margin-bottom:2px; }
.pw-activity-title { color:#ffffff; font-size:12px; font-weight:600; margin-bottom:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pw-activity-details { color:#b5bac1; font-size:11px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pw-activity-time { color:#949ba4; font-size:10px; margin-top:2px; }

.pw-spotify-progress { margin-top:4px; width:100%; }
.pw-progress-time { color:#949ba4; font-size:10px; margin-bottom:3px; }
.pw-progress-bar { width:100%; height:3px; background: rgba(255,255,255,0.1); border-radius:2px; overflow:hidden; }
.pw-progress-fill { height:100%; background:#1db954; transition: width 0.3s ease; }

/* Hide the spotify progress/time UI — user requested to remove the progress bar */
.pw-spotify-progress, .pw-progress-time, .pw-progress-bar, .pw-progress-fill { display: none !important; }

.pw-app-logo { width:44px; height:44px; border-radius:10px; flex-shrink:0; object-fit:cover; background:#2a2a2a; }

.pw-loading-box, .pw-error-box { color:#949ba4; font-size:13px; text-align:center; padding:24px; }
.pw-note { color:#6d6f78; font-size:11px; }

/* Responsive */
@media (max-width:420px) {
    .pw-widget { min-width: 0; width: 100%; }
    .pw-username { font-size: 13px; }
}

/* Centering modifier when widget is alone */
.pw-centered { margin: 0 auto; }

/* Center only the container; keep text left-aligned for readability */
.pw-centered .pw-username-line { justify-content: flex-start; }
.pw-centered .pw-badge-row { justify-content: flex-start; }

/* Embed card styled to visually match the presence widget */
.pw-embed {
    /* Match the presence widget visuals exactly */
    background-color: rgba(26,26,26,var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)));
    border-radius: 12px;
    /* add extra horizontal padding so the avatar/icon sits further from the left edge */
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 380px;
    /* Use same subtle border as the presence widget so visuals match */
    border: 1px solid rgba(255,255,255, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.06));
    box-shadow: 0 6px 18px rgba(0, 0, 0, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.65));
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.pw-embed .pw-embed-icon { width:48px; height:48px; border-radius:50%; background:transparent; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; }

/* Presence + embed row layout: ensure both columns match size */
.presence-embeds-row {
    display: flex;
    gap: 16px;
    align-items: center;
    /* when two columns are present, push them to the edges (left/right)
       so presence is left and embed is right. When only one column exists
       the CSS rule below will center it. */
    justify-content: space-between;
    flex-wrap: nowrap;
}
.presence-embeds-row.single { justify-content: center; }
/* Make both columns wide and flexible so they match the large widget size in screenshots */
/* Center row and limit overall width so cards don't touch edges */
.presence-embeds-row { display:flex; gap:16px; align-items:center; flex-wrap:nowrap; width:100%; max-width:760px; margin:0 auto; padding:0 24px; box-sizing:border-box; }
.presence-embeds-row.single { justify-content:center; }
/* Default two-column sizing */
.presence-embeds-row .presence-col { flex: 1 1 48%; display:flex; align-items:center; }
.presence-embeds-row .presence-col .pw-widget,
.presence-embeds-row .presence-col .pw-embed { box-sizing: border-box; width:100%; min-width:260px; max-width:460px; padding:10px 12px; height:80px; border-radius:12px; }

/* When only one card is present: center it and make it more compact (matches smaller screenshot) */
.presence-embeds-row.single .presence-col { flex: 0 0 auto; }
.presence-embeds-row.single .presence-col .pw-widget,
.presence-embeds-row.single .presence-col .pw-embed { width: 320px; max-width: 320px; min-width: 260px; padding:10px 12px; height:72px; }

/* Fine-tuned internals for a slightly taller, narrower card */
.presence-embeds-row.single .pw-embed .pw-embed-icon { width:46px; height:46px; margin-right:10px; margin-left:10px; }
.presence-embeds-row.single .pw-embed .pw-embed-title { font-size:14px; }
.presence-embeds-row.single .pw-embed .pw-embed-sub { font-size:12px; }
.presence-embeds-row.single .pw-embed-join { padding:7px 10px; font-size:13px; }
/* push second column to the right when both are present */
/* remove forced push to right so columns stay close; center used instead */
.presence-embeds-row .presence-col + .presence-col { margin-left: 0; }

/* If there is only one .presence-col inside the row, center it */
.presence-embeds-row .presence-col:first-child:last-child { margin: 0 auto; }
.pw-embed { display:flex; align-items:center; }
.pw-embed .pw-embed-inner { display:flex; align-items:center; justify-content:space-between; width:100%; }
.pw-embed .pw-embed-icon { width:48px; height:48px; border-radius:50%; background: rgba(26,26,26, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.08)); display:flex; align-items:center; justify-content:center; overflow:hidden; margin-right:12px; margin-left:11px; flex-shrink:0; box-shadow: 0 4px 14px rgba(0,0,0, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.35)); }
.pw-embed .pw-embed-icon img { width:48px; height:48px; object-fit:cover; display:block; }
.pw-embed .pw-embed-content { flex:1; margin-left:8px; min-width:0; }
.pw-embed .pw-embed-title { font-weight:700; color: rgba(255,255,255, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 1)); font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pw-embed .pw-embed-sub { color: rgba(255,255,255, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.72)); font-size:12px; margin-top:4px; }
.pw-embed .pw-embed-actions { margin-left:12px; }
.pw-embed-join { background:#5865f2;color:#fff;padding:8px 12px;border-radius:8px;text-decoration:none;font-weight:700;display:inline-block; box-shadow: 0 4px 10px rgba(88,101,242, calc(var(--pw-widget-opacity, var(--profile-opacity-decimal, 1)) * 0.24)); }
.pw-embed-join { background:#5865f2;color:#fff;padding:8px 12px;border-radius:8px;text-decoration:none;font-weight:700;display:inline-block; }

@media (max-width: 820px) {
    .presence-embeds-row { flex-wrap:wrap; }
    .presence-embeds-row .presence-col { flex: 1 1 100%; margin-left: 0 !important; }
    .presence-embeds-row .presence-col .pw-widget,
    .presence-embeds-row .presence-col .pw-embed { width:100%; min-width:0; max-width:none; }
}


