/* View4View - Modern YouTube-Style UI with Dark Mode */

:root {
    /* SaaS Light Mode */
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --header-bg: rgba(255,255,255,0.86);
    --sidebar-bg: #ffffff;
    --nav-bg: rgba(255,255,255,0.92);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --hover-bg: rgba(79,70,229,0.06);
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --shadow: rgba(17,24,39,0.10);
    --shadow-strong: rgba(17,24,39,0.16);
}

[data-theme="dark"] {
    /* SaaS Dark Mode */
    --bg-primary: #0b1020;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: rgba(255,255,255,0.10);
    --header-bg: rgba(17,24,39,0.70);
    --sidebar-bg: #0f172a;
    --nav-bg: rgba(15,23,42,0.78);
    --card-bg: rgba(17,24,39,0.72);
    --input-bg: rgba(17,24,39,0.72);
    --hover-bg: rgba(99,102,241,0.14);
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --shadow: rgba(0,0,0,0.50);
    --shadow-strong: rgba(0,0,0,0.65);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
}

.logo-container {
    margin-bottom: 20px;
}

.splash-screen h2 {
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 30px;
    font-size: 28px;
}

/* Loader */
.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(17,24,39,0.06);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px;
    margin-right: 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: var(--hover-bg);
}

.logo-brand {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 500;
    text-decoration: none;
}

.logo-brand i {
    color: var(--accent-color);
    margin-right: 8px;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.points-badge {
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 240px;
    height: calc(100vh - 56px);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 12px 0;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
}

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

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background: var(--hover-bg);
}

.sidebar-menu a.active {
    background: var(--hover-bg);
    border-left: 3px solid var(--accent-color);
    font-weight: 500;
}

.sidebar-menu i {
    width: 24px;
    margin-right: 24px;
    font-size: 20px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.sidebar-section-title {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-icons {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-icons a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s;
    text-decoration: none;
}

.social-icons a:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    margin-top: 56px;
    margin-bottom: 92px;
    min-height: calc(100vh - 116px);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.page {
    display: none;
    padding: 16px;
}

.page.active {
    display: block;
}

/* Video List */
.video-list {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.video-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}

.video-item:active {
    transform: scale(0.98);
}

.video-item:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: var(--bg-secondary);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-points {
    color: var(--accent-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-views {
    color: var(--text-tertiary);
}

/* Watch Page */
.watch-container {
    background: var(--bg-primary);
}

.youtube-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    width: 100%;
}

#youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.watch-timer-container {
    background: var(--card-bg);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.timer-countdown {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-color);
}

.timer-progress {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.timer-progress-bar {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.timer-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.watch-video-info {
    padding: 16px;
    background: var(--card-bg);
}

.watch-video-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.watch-video-points {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Forms */
.form-control {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255,0,0,0.1);
}

.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background: var(--accent-hover);
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 16px;
}

.card-body {
    padding: 16px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

/* Purchase Coins Page */
.coin-packages {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

/* Payment Page */
#payment-page {
    max-width: 600px;
    margin: 0 auto;
}

.coin-package {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.coin-package:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--shadow);
}

.coin-package.popular {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255,0,0,0.05) 100%);
}

.coin-package.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: 12px;
    right: -30px;
    background: var(--accent-color);
    color: white;
    padding: 4px 40px;
    font-size: 10px;
    font-weight: 600;
    transform: rotate(45deg);
    letter-spacing: 1px;
}

.package-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.package-coins {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.package-bonus {
    font-size: 14px;
    color: #4CAF50;
    margin-bottom: 12px;
    font-weight: 500;
}

.package-price {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.package-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.package-btn:hover {
    background: var(--accent-hover);
}

/* Wallet Page */
.wallet-balance {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 24px;
}

.wallet-balance h3 {
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
}

.wallet-balance p {
    font-size: 16px;
    opacity: 0.9;
}

/* Transactions */
.transaction-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.transaction-type.earn,
.transaction-type.admin_add,
.transaction-type.purchase {
    color: #4CAF50;
}

.transaction-type.spend,
.transaction-type.withdrawal {
    color: var(--accent-color);
}

.transaction-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.transaction-amount {
    text-align: right;
}

.transaction-amount .amount {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.transaction-amount .balance {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Profile */
.profile-header {
    text-align: center;
    padding: 32px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    margin: 0 auto 16px;
    object-fit: cover;
}

.profile-name {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #FFC107;
    color: #000;
}

.status-approved,
.status-completed {
    background: #4CAF50;
    color: white;
}

.status-rejected {
    background: var(--accent-color);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--text-tertiary);
}

.empty-state p {
    font-size: 16px;
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    text-align: center;
}

.login-box i {
    font-size: 80px;
    color: var(--accent-color);
    margin-bottom: 24px;
}

.login-box h2 {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 12px;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

/* Responsive */
@media (min-width: 768px) {
    .video-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .coin-packages {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .video-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .coin-packages {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease;
}

/* Payment Page */
#payment-page {
    max-width: 600px;
    margin: 0 auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-16 {
    margin-bottom: 16px;
}

.mt-16 {
    margin-top: 16px;
}



/* Material Symbols */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    vertical-align: middle;
}


/* Payment stepper */
.payment-steps{
    display:flex;
    gap:8px;
    margin-bottom:16px;
    flex-wrap:wrap;
}
.payment-step{
    font-size:12px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid var(--border-color);
    color:var(--text-secondary);
    background:var(--card-bg);
}
.payment-step.active{
    border-color:var(--accent-color);
    color:var(--accent-color);
    background:var(--hover-bg);
}

/* Video CTA */
.video-cta{margin-top:12px;display:flex;justify-content:flex-end;}
.video-watch-btn{border-radius:999px;padding:8px 12px;}
.video-progress{color:var(--text-tertiary);font-size:12px;}



/* Spinner icon smoothing */
.material-symbols-rounded{font-smooth:always;-webkit-font-smoothing:antialiased;}
