/* VideoCode Store — Plus Jakarta Sans + Green Theme */

:root {
    --vc-primary: #1e7b48;
    --vc-primary-dark: #155a34;
    --vc-primary-light: #34a853;
    --vc-accent: #e8f5e9;
    --vc-dark: #1a1a2e;
    --vc-muted: #718096;
    --vc-border: #e9ecef;
    --vc-bg: #f0f2f5;
    --vc-card: #ffffff;
    --vc-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --vc-radius: 16px;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--vc-bg);
    color: var(--vc-dark);
    min-height: 100vh;
}

/* ── Dashboard layout ───────────────────────────────────── */
.dashboard-page { overflow-x: hidden; }

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--vc-card);
    border-right: 1px solid var(--vc-border);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--vc-border);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--vc-primary);
}

.sidebar-brand i { font-size: 1.5rem; }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 12px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s;
}

.sidebar-link i { width: 20px; text-align: center; }

.sidebar-link:hover {
    background: var(--vc-accent);
    color: var(--vc-primary);
}

.sidebar-link.active {
    background: var(--vc-primary);
    color: #fff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--vc-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-user i { font-size: 2rem; color: var(--vc-primary); }
.sidebar-user strong { display: block; font-size: 0.9rem; }
.sidebar-user small { color: var(--vc-muted); font-size: 0.75rem; }

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: var(--vc-card);
    border-bottom: 1px solid var(--vc-border);
    box-shadow: var(--vc-shadow);
}

.sidebar-toggle {
    color: var(--vc-dark);
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.balance-pill {
    background: var(--vc-accent);
    color: var(--vc-primary);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

.app-content { padding: 1.5rem; flex: 1; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

/* ── Cards & stats ──────────────────────────────────────── */
.vc-card {
    background: var(--vc-card);
    border: 1px solid var(--vc-border);
    border-radius: var(--vc-radius);
    box-shadow: var(--vc-shadow);
}

.stat-card {
    background: var(--vc-card);
    border: 1px solid var(--vc-border);
    border-radius: var(--vc-radius);
    padding: 1.25rem;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.stat-icon.green { background: linear-gradient(135deg, var(--vc-primary), var(--vc-primary-light)); }
.stat-icon.blue { background: linear-gradient(135deg, #1a73e8, #4285f4); }
.stat-icon.orange { background: linear-gradient(135deg, #e65100, #f57c00); }
.stat-icon.purple { background: linear-gradient(135deg, #6a1b9a, #9c27b0); }

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0.5rem 0 0.15rem;
}

.stat-label {
    color: var(--vc-muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-vc-primary {
    background: linear-gradient(135deg, var(--vc-primary), var(--vc-primary-light));
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    transition: all 0.2s;
}

.btn-vc-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 123, 72, 0.3);
}

.btn-vc-outline {
    border: 2px solid var(--vc-primary);
    color: var(--vc-primary);
    font-weight: 700;
    border-radius: 12px;
    background: transparent;
}

.btn-vc-outline:hover {
    background: var(--vc-primary);
    color: #fff;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-vc th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--vc-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--vc-border);
}

.table-vc td { vertical-align: middle; font-size: 0.9rem; }

.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-paid, .badge-success, .badge-completed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-failed { background: #fee2e2; color: #991b1b; }

/* ── Video cards ────────────────────────────────────────── */
.video-card {
    border-radius: var(--vc-radius);
    overflow: hidden;
    border: 1px solid var(--vc-border);
    background: var(--vc-card);
    transition: transform 0.2s;
}

.video-card:hover { transform: translateY(-4px); }

.video-card .thumb {
    height: 140px;
    object-fit: cover;
    width: 100%;
    background: #111;
}

.video-card .thumb-placeholder {
    height: 140px;
    background: linear-gradient(135deg, #1a1a2e, var(--vc-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
}

.price-badge {
    background: var(--vc-accent);
    color: var(--vc-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.78rem;
}

.copy-input-group .form-control {
    border-radius: 12px 0 0 12px;
    font-size: 0.85rem;
}

.copy-input-group .btn {
    border-radius: 0 12px 12px 0;
}

/* ── Landing page ───────────────────────────────────────── */
.landing-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f3d24 0%, var(--vc-primary) 50%, var(--vc-primary-light) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.landing-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 0;
    z-index: 10;
}

.landing-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
}

.landing-brand span { opacity: 0.85; }

.landing-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.landing-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 520px;
    line-height: 1.6;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0.25rem;
    backdrop-filter: blur(4px);
}

.landing-mockup {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Login page ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f2f5 0%, var(--vc-accent) 100%);
    padding: 2rem 1rem;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: var(--vc-card);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(30, 123, 72, 0.12);
    border: 1px solid var(--vc-border);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--vc-primary);
}

.login-logo h2 {
    font-weight: 800;
    color: var(--vc-primary);
    margin-top: 0.5rem;
}

.form-control-vc {
    border-radius: 12px;
    border: 1.5px solid var(--vc-border);
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.form-control-vc:focus {
    border-color: var(--vc-primary);
    box-shadow: 0 0 0 3px rgba(30, 123, 72, 0.12);
}

/* ── Watch page ─────────────────────────────────────────── */
.watch-page {
    min-height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.watch-bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: blur(0);
    transition: filter 0.5s;
    pointer-events: none;
}

.watch-bg-video.blurred {
    filter: blur(22px) brightness(0.5);
}

.watch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
    transition: background 0.4s;
    pointer-events: none;
}

.watch-overlay.active { background: rgba(0, 0, 0, 0.5); }

.watch-modal {
    position: relative;
    z-index: 10;
    max-width: 460px;
    width: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.watch-modal-header {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
}

.watch-modal-header h2 {
    font-weight: 800;
    color: var(--vc-primary);
    font-size: 1.4rem;
}

.watch-player-wrap {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.watch-player-wrap video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.watch-timer-bar {
    background: var(--vc-primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.9rem;
}

.watch-timer-bar .timer-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

/* Landing templates */
.template-landing1 .watch-modal { border-top: 4px solid var(--vc-primary); }
.template-landing2 .watch-modal {
    background: linear-gradient(180deg, #fff 0%, var(--vc-accent) 100%);
    border: 2px solid var(--vc-primary);
}
.template-landing3 .watch-modal {
    background: var(--vc-dark);
    color: #fff;
}
.template-landing3 .watch-modal-header h2 { color: #fff; }
.template-landing3 .form-control { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; }

.payment-waiting {
    text-align: center;
    padding: 2rem;
}

.spinner-vc {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid var(--vc-accent);
    border-top-color: var(--vc-primary);
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

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

/* ── Footer ─────────────────────────────────────────────── */
.app-footer {
    padding: 1rem;
    color: var(--vc-muted);
    border-top: 1px solid var(--vc-border);
    background: var(--vc-card);
}

/* ── Forms & utilities ──────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--vc-border);
    border-radius: var(--vc-radius);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
}

.upload-zone:hover { border-color: var(--vc-primary); }

.upload-zone i {
    font-size: 2.5rem;
    color: var(--vc-primary);
    margin-bottom: 0.75rem;
}

.period-tabs .nav-link {
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--vc-muted);
    padding: 0.5rem 1rem;
}

.period-tabs .nav-link.active {
    background: var(--vc-primary);
    color: #fff;
}

.template-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.template-option {
    border: 2px solid var(--vc-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.template-option:hover { border-color: var(--vc-primary); }

.template-option.selected {
    border-color: var(--vc-primary);
    background: var(--vc-accent);
}

.template-option input { display: none; }

@media (max-width: 576px) {
    .template-picker { grid-template-columns: 1fr; }
    .stat-value { font-size: 1.25rem; }
}