:root {
  --tk-pink: #fe2c55;
  --tk-cyan: #25f4ee;
  --tk-black: #0e0e0e;
  --tk-dark: #161616;
  --tk-gray: #a8a8a8;
}

* { box-sizing: border-box; }

body {
  background: var(--tk-black);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

a { text-decoration: none; }

/* ---------------- NAVBAR ---------------- */
.tk-navbar {
  background: var(--tk-black);
  border-bottom: 1px solid #262626;
  height: 60px;
  z-index: 1000;
}

.tk-logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff !important;
}
.tk-logo span { color: var(--tk-pink); }

.tk-search {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 30px;
  width: 340px;
  overflow: hidden;
}
.tk-search input {
  background: transparent;
  border: none;
  color: #fff;
  box-shadow: none !important;
}
.tk-search input::placeholder { color: #777; }
.tk-search .btn { color: #fff; border: none; }

.tk-btn-primary {
  background: var(--tk-pink);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
}
.tk-btn-primary:hover { background: #e0264c; color: #fff; }

.tk-btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  font-weight: 600;
}
.tk-btn-outline:hover { background: #262626; color: #fff; border-color: #555; }

.tk-coin-badge {
  background: #1e1e1e;
  color: #ffd166;
  border: 1px solid #333;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 12px;
}

.tk-avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #333;
}

.tk-dropdown {
  background: #1e1e1e;
  border: 1px solid #333;
}
.tk-dropdown .dropdown-item { color: #fff; }
.tk-dropdown .dropdown-item:hover { background: #2a2a2a; color: var(--tk-pink); }

.tk-muted { color: var(--tk-gray); }

/* ---------------- FEED ---------------- */
.tk-feed {
  height: 100vh;
  padding-top: 60px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

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

.tk-video {
  height: 100%;
  max-width: 500px;
  width: 100%;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
}

.tk-video-overlay {
  position: absolute;
  inset: 0;
  max-width: 500px;
  margin: 0 auto;
  cursor: pointer;
}

.tk-caption-box {
  position: absolute;
  left: calc(50% - 250px + 16px);
  bottom: 30px;
  max-width: 360px;
  z-index: 5;
}
@media (max-width: 560px) {
  .tk-caption-box { left: 16px; }
}

.tk-username {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 6px;
}
.tk-caption-text {
  color: #eee;
  font-size: 0.92rem;
  margin-bottom: 0;
}

.tk-side-actions {
  position: absolute;
  right: calc(50% - 250px - 60px);
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  z-index: 5;
}
@media (max-width: 560px) {
  .tk-side-actions { right: 8px; }
}

.tk-side-item {
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.6rem;
  line-height: 1;
  gap: 4px;
  cursor: pointer;
}
.tk-side-item .tk-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.tk-side-item.active, .tk-like-btn.active { color: var(--tk-pink); }
.tk-gift-btn { color: #ffd166; }

.tk-avatar-link { position: relative; margin-bottom: 4px; }
.tk-avatar-md {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}
.tk-follow-plus {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--tk-pink);
  border: 2px solid #fff;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 0.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tk-follow-check {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  color: #25d366;
  font-size: 1rem;
  background: #000;
  border-radius: 50%;
}

.tk-empty {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------------- AUTH / FORM PAGES ---------------- */
.tk-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 16px 40px;
}
.tk-auth-card {
  background: var(--tk-dark);
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 36px 30px;
  width: 100%;
  max-width: 420px;
}
.tk-auth-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }

.tk-input {
  background: #0e0e0e;
  border: 1px solid #333;
  color: #fff;
}
.tk-input:focus {
  background: #0e0e0e;
  color: #fff;
  border-color: var(--tk-pink);
  box-shadow: none;
}
.tk-input::placeholder { color: #666; }

/* ---------------- PROFILE ---------------- */
.tk-profile-wrap {
  padding: 90px 16px 40px;
  max-width: 900px;
  margin: 0 auto;
}
.tk-profile-header { text-align: center; }
.tk-avatar-lg {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #262626;
}
.tk-profile-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 16px;
}
.tk-profile-stats div { display: flex; flex-direction: column; }
.tk-profile-stats span { color: var(--tk-gray); font-size: 0.8rem; }

.tk-divider { border-color: #262626; margin: 30px 0; }

.tk-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 3px;
}
.tk-grid-item {
  position: relative;
  aspect-ratio: 9/16;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
}
.tk-grid-item video { width: 100%; height: 100%; object-fit: cover; }
.tk-grid-overlay {
  position: absolute;
  bottom: 6px; left: 6px;
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--tk-pink);
}

/* ---------------- MODALS ---------------- */
.tk-modal {
  background: var(--tk-dark);
  color: #fff;
  border: 1px solid #333;
}
.modal-dialog-end {
  position: fixed;
  right: 0; top: 0;
  margin: 0;
  height: 100%;
  max-width: 380px;
  width: 100%;
}
.modal-dialog-end .tk-modal { height: 100%; border-radius: 0; }

#commentList { max-height: 100%; overflow-y: auto; }
.tk-comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.tk-comment-item img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.tk-comment-item .tk-comment-user { font-weight: 600; font-size: 0.85rem; }
.tk-comment-item .tk-comment-text { font-size: 0.85rem; color: #ddd; }
.tk-comment-item .tk-comment-time { font-size: 0.7rem; color: #777; }

.tk-gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tk-gift-card {
  background: #0e0e0e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.tk-gift-card:hover { border-color: var(--tk-pink); transform: translateY(-3px); }
.tk-gift-card .icon { font-size: 1.8rem; }
.tk-gift-card .name { font-size: 0.8rem; margin-top: 4px; }
.tk-gift-card .cost { font-size: 0.75rem; color: #ffd166; }

/* Floating gift animation */
.tk-flying-gift {
  position: fixed;
  font-size: 2.5rem;
  z-index: 3000;
  pointer-events: none;
  animation: tkFly 1.4s ease-out forwards;
}
@keyframes tkFly {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20px) scale(1.2); }
  100% { transform: translateY(-220px) scale(1); opacity: 0; }
}
