:root {
    --bg: #000000;
    --surface: #121212;
    --text: #ffffff;
    --muted: #a0a0a0;
    --accent: #fe2c55; /* tiktok-ish accent */
    --accent-2: #25f4ee;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
    height: 100%;
    overscroll-behavior: none;
    touch-action: pan-y; /* pinch-zoom disable, vertical scroll allow */
}

/* ---------- Text copy protection (deterrent, see protect.js note) ---------- */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text; /* form field e obosshoi type/select korte hobe */
}

img, video {
    -webkit-user-drag: none;
    pointer-events: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

/* ---------- Top navigation ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    z-index: 100;
    border-bottom: 1px solid #222;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
}

.topnav {
    display: flex;
    gap: 18px;
    font-size: 14px;
}

.topnav a {
    color: var(--muted);
}

.topnav a:hover {
    color: var(--text);
}

.app-main {
    padding-top: 56px;
    height: 100vh;
}

/* ---------- Feed ---------- */
.feed {
    height: calc(100vh - 56px);
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.video-card {
    position: relative;
    height: calc(100vh - 56px);
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 16px 28px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}

.video-info {
    max-width: 75%;
}

.video-username {
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.video-caption {
    margin: 0;
    font-size: 14px;
    color: #eee;
}

.video-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
}

.action-btn .count {
    font-size: 12px;
    margin-top: 2px;
}

.action-btn.liked .icon {
    color: var(--accent);
}

.views-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 20px;
    color: var(--muted);
}

.views-badge .count {
    font-size: 12px;
}

.feed-loader {
    text-align: center;
    padding: 20px;
    color: var(--muted);
}

/* ---------- Comments drawer ---------- */
.comments-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--surface);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.comments-drawer-header {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #222;
    font-weight: 700;
}

.comments-drawer-header button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.comment-item {
    margin-bottom: 10px;
    font-size: 14px;
}

.comment-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #222;
    gap: 8px;
}

.comment-form input {
    flex: 1;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 10px 14px;
    color: var(--text);
}

.comment-form button {
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 20px;
    padding: 0 18px;
    cursor: pointer;
}

/* ---------- Auth pages ---------- */
.auth-container, .upload-container, .profile-container {
    max-width: 420px;
    margin: 40px auto;
    padding: 24px;
}

.auth-form, .upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input, .upload-form input, .upload-form textarea {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-size: 14px;
}

.auth-form button, .upload-form button, .follow-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.auth-switch {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
}

.auth-switch a {
    color: var(--accent-2);
}

.form-error {
    color: var(--accent);
    font-size: 13px;
    min-height: 18px;
}

.file-label {
    font-size: 14px;
    color: var(--muted);
}

.upload-preview {
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
    background: #000;
}

.upload-progress {
    width: 100%;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    height: 8px;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s ease;
}

/* ---------- Profile ---------- */
.profile-header {
    text-align: center;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    background: #222;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 14px 0;
}

.profile-stats div {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--muted);
}

.profile-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 20px;
}
