/* ============================================================
   Save to PDF — Frontend Styles
   ============================================================ */

:root {
    --stp-primary: #1a1a2e;
    --stp-accent:  #e94560;
    --stp-white:   #ffffff;
    --stp-radius-pill: 50px;
    --stp-radius-sq:   6px;
    --stp-shadow: 0 4px 20px rgba(0,0,0,0.15);
    --stp-shadow-hover: 0 8px 30px rgba(0,0,0,0.25);
    --stp-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ──────────────────────────────────────────────── */
.stp-button-wrapper {
    display: flex;
    margin: 16px 0 24px;
    clear: both;
}
.stp-align-left   { justify-content: flex-start; }
.stp-align-center { justify-content: center; }
.stp-align-right  { justify-content: flex-end; }

/* ── Base Button ──────────────────────────────────────────── */
.stp-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--stp-white);
    background: var(--stp-primary);
    border: none;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: var(--stp-transition);
    box-shadow: var(--stp-shadow);
    outline: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
}

/* Shimmer pseudo-element */
.stp-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.12),
        transparent
    );
    transition: left 0.45s ease;
}
.stp-button:hover::before { left: 100%; }

/* Accent left-border */
.stp-button::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--stp-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.stp-button:hover::after { opacity: 1; }

.stp-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--stp-shadow-hover);
    background: color-mix(in srgb, var(--stp-primary) 85%, black);
}
.stp-button:active { transform: translateY(0); }
.stp-button:focus-visible {
    outline: 2px solid var(--stp-accent);
    outline-offset: 3px;
}

/* ── Shape variants ───────────────────────────────────────── */
.stp-style-pill   { border-radius: var(--stp-radius-pill); }
.stp-style-square { border-radius: var(--stp-radius-sq); }
.stp-style-minimal {
    background: transparent;
    color: var(--stp-primary);
    box-shadow: none;
    border: 1.5px solid var(--stp-primary);
    border-radius: var(--stp-radius-sq);
    padding: 9px 20px;
}
.stp-style-minimal:hover {
    background: var(--stp-primary);
    color: var(--stp-white);
    box-shadow: var(--stp-shadow);
}

/* ── Icon ─────────────────────────────────────────────────── */
.stp-btn-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.stp-button:hover .stp-btn-icon { transform: translateY(-1px); }

/* ── Loader ───────────────────────────────────────────────── */
.stp-btn-loader {
    display: none;
    align-items: center;
}
.stp-spin-path {
    animation: stp-spin 0.8s linear infinite;
    transform-origin: center;
}
@keyframes stp-spin {
    from { stroke-dashoffset: 0; transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Loading state */
.stp-button.stp-loading .stp-btn-icon { display: none; }
.stp-button.stp-loading .stp-btn-loader { display: flex; }
.stp-button.stp-loading { opacity: 0.8; cursor: wait; pointer-events: none; }

/* Success state */
.stp-button.stp-success {
    background: #2d7a4f !important;
    pointer-events: none;
}
.stp-button.stp-success::after { opacity: 0 !important; }

/* ── Toast notification ───────────────────────────────────── */
.stp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--stp-primary);
    color: var(--stp-white);
    padding: 12px 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
}
.stp-toast.stp-toast-show {
    transform: translateY(0);
    opacity: 1;
}
.stp-toast-icon { font-size: 18px; flex-shrink: 0; }
.stp-toast.stp-toast-error { background: #c0392b; }
.stp-toast.stp-toast-success { background: #2d7a4f; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .stp-button-wrapper { justify-content: center !important; }
    .stp-button { font-size: 13px; padding: 9px 18px; }
}
