/* ─────────────────────────────────────────────────────────────
   Video Membership — Dark Theme
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a14;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.page-body {
    align-items: flex-start;
    padding: 2rem 1rem;
}

a { color: #6c63ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: #12121e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}
.card.dashboard, .card.event-page { max-width: 960px; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.topbar h1 { font-size: 1.3rem; color: #fff; }
.email-bar { color: #888; font-size: .85rem; }

/* ── Typography ────────────────────────────────────────────── */
h1 { color: #fff; margin-bottom: .5rem; font-size: 1.4rem; }
.subtitle { color: #888; font-size: .9rem; margin-bottom: 1.5rem; }
.hint { color: #555; font-size: .8rem; margin-top: 1.5rem; line-height: 1.4; }
.empty { color: #666; text-align: center; padding: 2rem 0; }

/* ── Form Elements ─────────────────────────────────────────── */
input[type="email"],
input[type="password"],
input[type="text"],
select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #3a3a5a;
    border-radius: 8px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color .2s;
}
input:focus, select:focus { border-color: #6c63ff; }

button, .btn, .btn-pay {
    display: inline-block;
    width: 100%;
    padding: .75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #6c63ff;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    text-align: center;
    text-decoration: none;
}
button:hover, .btn:hover, .btn-pay:hover { background: #5a52e0; }

.btn-sm {
    display: inline-block;
    padding: .35rem .75rem;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.btn-sm:hover { border-color: #6c63ff; color: #fff; text-decoration: none; }

.link-muted { color: #666; font-size: .85rem; }
.link-muted:hover { color: #aaa; }

/* ── Messages ──────────────────────────────────────────────── */
.msg {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    line-height: 1.5;
}
.msg.success { background: #132613; border: 1px solid #1e4a1e; color: #6fbf6f; }
.msg.error   { background: #2a1010; border: 1px solid #5a2020; color: #ff6b6b; }
.msg.info    { background: #0f1a2e; border: 1px solid #1a3a5c; color: #6baeff; }

/* ── Event Grid (Dashboard) ───────────────────────────────── */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}
.event-card {
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: border-color .2s, transform .2s;
}
.event-card.unlocked:hover {
    border-color: #6c63ff;
    transform: translateY(-3px);
}
.event-card.locked { opacity: .65; }
.event-card.locked:hover {
    border-color: #ff6b6b;
    opacity: .8;
    transform: translateY(-2px);
}

.event-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #16162a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.event-icon { font-size: 2.5rem; color: #3a3a5a; }

.badge {
    position: absolute;
    top: .6rem;
    right: .6rem;
    padding: .25rem .6rem;
    border-radius: 5px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.badge-open   { background: rgba(40,167,69,.85); color: #fff; }
.badge-locked { background: rgba(220,53,69,.85); color: #fff; }

.event-info { padding: .85rem 1rem; }
.event-title { color: #e0e0e0; font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.event-meta  { color: #888; font-size: .78rem; margin-bottom: .6rem; }

.action-label {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 500;
}
.action-watch { background: #6c63ff; color: #fff; }
.action-buy   { background: transparent; border: 1px solid #ff6b6b; color: #ff6b6b; }
.event-card.locked:hover .action-buy { background: #ff6b6b; color: #fff; }

/* ── Video Grid (Event page) ──────────────────────────────── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.video-card {
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
}
.video-card:hover { border-color: #6c63ff; transform: translateY(-2px); }

.video-thumb {
    aspect-ratio: 16 / 9;
    background: #16162a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-thumb span { font-size: 2rem; color: #3a3a5a; }
.video-card:hover .video-thumb span { color: #6c63ff; }

.video-info { padding: .65rem .85rem; }
.video-title { color: #ccc; font-size: .85rem; line-height: 1.3; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #6c63ff;
    font-size: .9rem;
}

/* ── Player Modal ─────────────────────────────────────────── */
.player-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.player-wrap {
    width: 100%;
    max-width: 900px;
    position: relative;
}
.player-wrap h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: .75rem;
}
.player-wrap video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}
.player-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: auto;
    padding: 0;
}

/* ── Catalog List (Payment page) ──────────────────────────── */
.catalog-list {
    list-style: none;
    margin: 1.25rem 0;
}
.catalog-item {
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: .6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.catalog-info strong { color: #e0e0e0; font-size: .95rem; }
.catalog-meta { display: block; color: #888; font-size: .78rem; margin-top: .15rem; }
.catalog-item form { margin: 0; }
.catalog-item .btn-sm { white-space: nowrap; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .event-grid { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .topbar { flex-direction: column; align-items: flex-start; }
    .catalog-item { flex-direction: column; align-items: stretch; }
}
