/* ═══════════════════════════════════════════════════
   SmashPass — modal & card stack
═══════════════════════════════════════════════════ */

/* ─── Modal overlay ──────────────────────────────── */

.sp-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.sp-modal--visible {
    opacity: 1;
    pointer-events: all;
}

.sp-body-lock {
    overflow: hidden;
}

.sp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--scrim-brand);
    backdrop-filter: blur(var(--scrim-blur));
}

/* ─── Modal box ──────────────────────────────────── */

.sp-modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 32px 16px 28px;
    z-index: 1;
}

.sp-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1600;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background .15s;
    backdrop-filter: blur(4px);
}

.sp-modal-close:hover { background: rgba(255,255,255,.3); }

/* ─── Card stack ─────────────────────────────────── */

.sp-stack-wrapper {
    position: relative;
    width: 100%;
    max-width: 340px;
    height: 460px;
}

.sp-card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    background: #1a1a1a;
    touch-action: none;
    will-change: transform;
    transition: transform .18s ease;
}

.sp-card[data-depth="1"] {
    transform: scale(0.96) translateY(10px);
}

.sp-card[data-depth="2"] {
    transform: scale(0.92) translateY(20px);
}

.sp-card:active { cursor: grabbing; }

/* ─── Card image ──────────────────────────────────── */

.sp-card-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
}

/* ─── Flag ───────────────────────────────────────── */

.sp-card-flag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,.7));
}

.sp-flag-icon {
    display: block;
    width: 26px;
    height: 18px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
}

/* ─── Swipe overlays ─────────────────────────────── */

.sp-card-overlay-smash,
.sp-card-overlay-pass {
    position: absolute;
    top: 20px;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity .08s linear;
    border: 3px solid;
}

.sp-card-overlay-smash {
    left: 18px;
    color: var(--accent-soft);
    border-color: var(--accent-soft);
    background: rgba(255,77,109,.12);
    text-shadow: 0 0 12px rgba(255,77,109,.5);
}

.sp-card-overlay-pass {
    right: 18px;
    color: #888;
    border-color: #888;
    background: rgba(0,0,0,.2);
}

/* ─── Card info overlay ──────────────────────────── */

.sp-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 16px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,.82));
    color: #fff;
}

.sp-card-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sp-card-age {
    font-weight: 400;
    font-size: 18px;
}

.sp-verified {
    color: #4fc3f7;
    font-size: 16px;
    vertical-align: middle;
    margin-left: 4px;
}

.sp-card-location {
    font-size: 13px;
    opacity: .8;
    margin-bottom: 2px;
}

.sp-card-price {
    font-size: 13px;
    opacity: .7;
}

.sp-card-link {
    position: absolute;
    top: 12px;
    right: 12px;
    color: rgba(255,255,255,.6);
    font-size: 18px;
    transition: color .15s;
}

.sp-card-link:hover { color: #fff; }

/* ─── Action buttons ─────────────────────────────── */

.sp-actions {
    display: flex;
    align-items: center;
}

.sp-btns-row {
    display: flex;
    align-items: center;
    gap: 22px;
}

.sp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    color: #fff;
}

.sp-btn:active { transform: scale(.91); }
.sp-btn:disabled { opacity: .3; cursor: not-allowed; }
.sp-btn i { line-height: 1; }

.sp-btn-smash {
    width: 74px;
    height: 74px;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent));
    box-shadow: 0 0 28px rgba(255,77,109,.55), 0 6px 20px rgba(255,77,109,.3);
}
.sp-btn-smash i { font-size: 30px; }
.sp-btn-smash:hover:not(:disabled) { box-shadow: 0 0 36px rgba(255,77,109,.7), 0 8px 24px rgba(255,77,109,.4); }

.sp-btn-pass {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,.07);
    border: 1.5px solid rgba(255,255,255,.18);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    color: #bbb;
}
.sp-btn-pass i { font-size: 26px; }
.sp-btn-pass:hover:not(:disabled) { background: rgba(255,255,255,.12); }

.sp-btn-undo {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.45);
}
.sp-btn-undo i { font-size: 20px; }

/* ─── Counter ────────────────────────────────────── */

.sp-counter {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1600;
    background: rgba(0,0,0,.45);
    border-radius: 20px;
    padding: 4px 12px;
    color: rgba(255,255,255,.75);
    font-size: 12px;
    letter-spacing: 0.4px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.sp-counter:empty {
    display: none;
}

/* ─── Loading spinner ────────────────────────────── */

.sp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.sp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: #ff4d6d;
    border-radius: 50%;
    animation: sp-spin .7s linear infinite;
}

@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ─── Empty state ────────────────────────────────── */

.sp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 24px;
    color: rgba(255,255,255,.7);
}

.sp-empty-icon { font-size: 64px; margin-bottom: 12px; color: var(--accent-soft); line-height: 1; }
.sp-empty-icon i { font-size: 64px; }
.sp-empty-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.sp-empty-text { font-size: 14px; }

.sp-btn-retry {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    background: var(--accent-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.sp-btn-retry:hover { opacity: .88; }
.sp-btn-retry:active { transform: scale(.96); }

/* ─── Undo animation ─────────────────────────────── */

.sp-card--undo-in {
    transform: translateX(-120%) rotate(-20deg) !important;
    transition: none !important;
}

/* ─── Profile page — client vote grid ────────────── */

.sp-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.sp-profile-card {
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #fff);
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    position: relative;
}

.sp-profile-card-img-link {
    display: block;
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.sp-profile-card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}

.sp-profile-card-img-link:hover img { transform: scale(1.04); }

.sp-profile-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.sp-profile-card-badge--smash { background: #ff4d6d; }
.sp-profile-card-badge--pass  { background: #555; }

.sp-profile-card-body {
    padding: 10px 12px;
    position: relative;
}

.sp-profile-card-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.sp-profile-card-loc  { font-size: 12px; opacity: .6; }
.sp-profile-card-date { font-size: 11px; opacity: .45; margin-top: 4px; }

.sp-profile-remove-vote {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: color .15s;
}

.sp-profile-remove-vote:hover { color: #e53935; }

/* ─── Profile page — owner vote rows ─────────────── */

.sp-owner-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-owner-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    background: var(--card-bg, #fff);
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}

.sp-owner-row-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sp-owner-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-owner-row-body { flex: 1; min-width: 0; }
.sp-owner-row-ad   { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-owner-row-voter { font-size: 13px; opacity: .7; margin-top: 2px; }
.sp-owner-row-date  { font-size: 11px; opacity: .45; margin-top: 2px; }

.sp-owner-row-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.sp-badge--smash { background: var(--accent-soft); }
.sp-badge--pass  { background: #666; }

.sp-owner-row-chat { font-size: 12px; }

/* ─── Mobile ─────────────────────────────────────── */

@media (max-width: 480px) {
    .sp-modal-box {
        padding: 16px 8px;
        gap: 14px;
    }

    .sp-stack-wrapper {
        height: 400px;
        max-width: 100%;
    }

    .sp-profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
