/* ==============================
   Design tokens
   ============================== */
:root {
    /* Global animation: ease-out (no acceleration, deceleration at end — like Apple) */
    --ease:     cubic-bezier(0, 0, 0.3, 1);
    /* Smooth start animation for perfectly synchronized expansion and delayed starts */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.15s;

    /* Card */
    --card-bg:     #ffffff;
    --card-radius: 20px;

    /*
     * Soft bevel: outer offset shadows visible against #f2f2f7 page bg.
     * Using blur (3rd param > 0) keeps edges diffuse/soft, not sharp.
     */
    --card-shadow:
        /* elevation */
        0 3px 14px rgba(0, 0, 0, 0.06),
        0 1px 4px  rgba(0, 0, 0, 0.04),
        /* outer ring */
        0 0 0 1px  rgba(0, 0, 0, 0.048),
        /* bevel top-left: diffuse white glow (visible on gray bg) */
        -1px -2px 5px 0 rgba(255, 255, 255, 0.65),
        /* bevel bottom-right: soft dark shadow */
        2px 4px 9px 0 rgba(0, 0, 0, 0.035),
        /* inner bottom shade */
        inset 0 -1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow-hover:
        0 6px 22px rgba(0, 0, 0, 0.08),
        0 2px 6px  rgba(0, 0, 0, 0.05),
        0 0 0 1px  rgba(0, 0, 0, 0.048),
        -1px -2px 5px 0 rgba(255, 255, 255, 0.65),
        2px 5px 11px 0 rgba(0, 0, 0, 0.045),
        inset 0 -1px 3px rgba(0, 0, 0, 0.04);
}

/* ==============================
   Card — universal component
   ============================== */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    transition: box-shadow var(--duration) var(--ease);
    box-shadow: var(--card-shadow);
    overflow-wrap: break-word;
    word-break: break-word;
}
.card--lg          { border-radius: 24px; }
.card--interactive:hover { box-shadow: var(--card-shadow-hover); }

/* Expandable body — use global ease instead of Tailwind's ease-in-out */
[id^=card-expandable-body-] {
    transition-timing-function: var(--ease-smooth);
}



/* App container — clipping removed to let arrow float outside */
/* Add clipping to body to prevent whole page scroll when float btn extends edge */
body {
    overflow-x: clip;
}

/* ==============================
   Scrollbar hide
   ============================== */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ==============================
   Animations
   ============================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fade-in { animation: fadeIn var(--duration) var(--ease) forwards; }

/* ==============================
   Timer Circle
   ============================== */
.timer-progress { transition: stroke-dashoffset 1s linear; }
.timer-progress.complete { stroke: #34c759; transition: stroke-dashoffset 1s linear, stroke 0.4s ease; }

/* ==============================
   Sort Tabs
   ============================== */
.sort-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: #e5e5ea;
    color: #8a8a8e;
    white-space: nowrap;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
    border: none;
    cursor: pointer;
}
.sort-tab.active-sort {
    background: #000;
    color: #fff;
}

/* ==============================
   Verification check states
   ============================== */
#check-navigate.passed,
#check-time.passed,
#check-return.passed,
#check-validate.passed {
    color: #000;
    background: #f0f0f0;
}
#check-navigate.passed .check-icon svg,
#check-time.passed .check-icon svg,
#check-return.passed .check-icon svg,
#check-validate.passed .check-icon svg {
    stroke: #34c759;
    stroke-width: 3;
}

#check-validate.failed {
    color: #000;
    background: #fff2f2;
}
#check-validate.failed .check-icon svg {
    stroke: #ff3b30;
    stroke-width: 3;
}

#check-validate.loading .check-icon svg {
    display: none;
}
#check-validate.loading .check-icon::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #d1d1d6;
    border-top-color: #000;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==============================
   URL Status
   ============================== */
.url-ok  { color: #34c759; }
.url-err { color: #ff3b30; }

/* ==============================
   Nickname indicator
   ============================== */
#nickname-indicator { color: #34c759; font-size: 12px; transition: color 0.2s; }

/* ==============================
   Toast notifications
   ============================== */
.toast {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    background: #1c1c1e;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: fadeIn var(--duration) var(--ease) forwards;
    transition: opacity 0.3s var(--ease);
}
.toast-success { background: #1c1c1e; }
.toast-error   { background: #1c1c1e; color: #aeaeb2; }
.toast-out     { opacity: 0; }

/* ==============================
   My Petition item (legacy support)
   ============================== */
.my-petition-item {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
}
.my-petition-title {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    line-height: 1.3;
}
.my-petition-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #8a8a8e;
    font-weight: 500;
    flex-wrap: wrap;
}
.my-petition-rank { font-weight: 700; color: #000; }

/* ==============================
   Leaderboard
   ============================== */
#leaderboard-section { padding-bottom: 32px; }

/* ==============================
   Onboarding
   ============================== */
#onboard-screen { font-family: 'Inter', sans-serif; }

/* ==============================
   Signers modal backdrop animation
   ============================== */
#signers-modal .absolute { animation: fadeIn 0.15s ease forwards; }

/* ==============================
   Dev Tools (local testing)
   ============================== */
.dev-tools {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 60;
    width: 260px;
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    font-family: 'Inter', sans-serif;
}
.dev-tools.hidden { display: none; }
.dev-tools-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8a8e;
    margin-bottom: 8px;
}
.dev-tools-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.dev-tools-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
.dev-tools-btn:disabled { opacity: 0.6; cursor: default; }
.dev-tools-btn-secondary {
    background: #e5e5ea;
    color: #000;
    width: 90px;
}
.dev-tools-select {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #e5e5ea;
    background: #f2f2f7;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
}
.dev-tools-status {
    margin-top: 8px;
    font-size: 12px;
    color: #8a8a8e;
    min-height: 14px;
}
