/*
 * Components — buttons, badges, cards, accordion.
 */

/* ── Buttons ──────────────────────────────────────────────── */
.btn-gradient,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-gradient {
    color: #fff !important;
    background: linear-gradient(90deg, #f51266, #ff7a2f);
    box-shadow: var(--shadow-glow);
}

.btn-gradient:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-lg);
}

.btn-outline {
    border: 1px solid #6c344e;
    background: rgba(7, 13, 25, 0.6);
    color: #fff;
}

.btn-outline:hover {
    color: #fff;
    border-color: #ff2b72;
}

.btn-smx {
    min-height: 40px;
    min-width: 82px;
    padding: 0 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* ── Icon button ──────────────────────────────────────────── */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0;
    cursor: pointer;
}

.icon-btn svg {
    width: 21px;
    height: 21px;
}

/* ── Badge pill ───────────────────────────────────────────── */
.badge-pill {
    display: inline-block;
    padding: 5px 9px;
    border-radius: var(--radius-full);
    background: #e81662;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* ── Cards base ───────────────────────────────────────────── */
.card-base {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(180deg, #0a1422, #08101d);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ── Accordion (details/summary) ──────────────────────────── */
.accordion details {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--panel);
}

.accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion-body {
    padding: 0 20px 20px;
    color: var(--muted);
}

/* ── Visually hidden ──────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Primary button (solid, for forms) ─────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(90deg, #f51266, #ff7a2f);
    box-shadow: var(--shadow-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    min-height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.btn-ghost:hover {
    border-color: var(--pink);
    color: #fff;
}

/* ── Utility classes ──────────────────────────────────────── */
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }

/* ── Play dot (for "See how it works" button) ─────────────── */
.play-dot {
    font-size: 12px;
}

/* ── Alert ────────────────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: var(--fs-base);
    font-weight: 500;
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success);
}

.alert-error {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    color: var(--color-danger);
}

.alert-warning {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning);
}

.alert-info {
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    color: var(--color-info);
}

.alert.is-hidden {
    display: none;
}

/* ── Auth drawer (slide-in from right) ─────────────────────── */
.auth-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(2, 7, 19, 0.97);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.auth-drawer.is-open {
    transform: translateX(0);
}

.auth-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.auth-drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-drawer-title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text);
}

.auth-drawer-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

.auth-drawer-close:hover {
    color: var(--pink);
}

.auth-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.auth-drawer-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.auth-drawer-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    padding: 10px 0;
    font-size: var(--fs-base);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.auth-drawer-tab:hover {
    color: var(--text);
}

.auth-drawer-tab.active {
    color: var(--pink);
    border-bottom-color: var(--pink);
}

.auth-drawer-tab-content.is-hidden {
    display: none;
}

.auth-drawer-google {
    margin-bottom: 16px;
    text-align: center;
}

.auth-drawer-greeting {
    text-align: center;
    padding: 16px 0;
    font-size: var(--fs-base);
    color: var(--muted);
    margin-bottom: 10px;
}

.auth-drawer-menu-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
    font-size: var(--fs-base);
}

.auth-drawer-menu-item:hover {
    background: var(--panel);
    color: var(--pink);
}

.auth-drawer-logout {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: var(--fs-base);
}

.auth-drawer-logout:hover {
    color: var(--color-danger);
}

/* ── Auth divider ─────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line);
}

.auth-divider span {
    padding: 0 10px;
}

/* ── Auth drawer form inputs (match reference login page) ─── */
.auth-drawer .form-input {
    background: #07101d;
    border-color: #243147;
    border-radius: 10px;
    min-height: 46px;
}

.auth-drawer .form-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 60, 127, 0.12);
}

.auth-drawer .form-check-input:checked {
    background-color: var(--pink);
    border-color: var(--pink);
}

.auth-drawer .btn-primary {
    background: linear-gradient(90deg, #f51266, #ff7a2f);
    border-radius: 9px;
    min-height: 46px;
    font-weight: 750;
}

.auth-drawer .form-helper {
    color: var(--subtle);
}

.auth-drawer .text-sm a {
    color: #ff5d93;
}

.auth-drawer .text-sm a:hover {
    color: #ff7aa8;
}

/* ── Google sign-in divider in drawer ─────────────────────── */
.auth-drawer .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #7f8a99;
    font-size: 13px;
    margin: 18px 0;
}

.auth-drawer .divider::before,
.auth-drawer .divider::after {
    content: '';
    height: 1px;
    background: var(--line);
    flex: 1;
}

/* ── Favorite button ─────────────────────────────────────── */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(2, 7, 19, 0.55);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.favorite-btn:hover {
    background: rgba(2, 7, 19, 0.8);
    transform: scale(1.1);
}
.favorite-btn .heart-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    transition: fill 0.2s, stroke 0.2s;
}
.favorite-btn.is-favorited .heart-icon {
    fill: var(--pink);
    stroke: var(--pink);
}

/* ── Scroll-to-top button ────────────────────────────────── */
.scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 90;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(10, 16, 28, 0.92);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
    backdrop-filter: blur(8px);
}
.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top:hover {
    background: rgba(255, 31, 109, 0.15);
    border-color: rgba(255, 31, 109, 0.3);
}
.scroll-top svg {
    width: 18px;
    height: 18px;
}

/* ── Responsive — auth drawer & touch targets ────────────── */
@media (max-width: 991.98px) {
    .auth-drawer {
        width: 360px;
        max-width: 90vw;
    }
}

@media (max-width: 767.98px) {
    .auth-drawer {
        width: 100vw;
        max-width: 100vw;
    }
    .auth-drawer-body {
        padding: 20px 16px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    .btn-ghost,
    .btn-sm {
        min-height: 44px;
    }
}
