/* ===========================
   lvideos - Pure HTML+CSS
   Global Stylesheet
   =========================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink-50: #fdf2f8;
  --pink-200: #fbcfe8;
  --pink-500: #ec4899;
  --pink-700: #be185d;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  display: block;
}

/* --- Layout --- */
.container {
  max-width: 640px;
  margin: 0 auto;
}

.pb-16 { padding-bottom: 4rem; }
.pb-20 { padding-bottom: 5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* --- Search Box --- */
.search-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.5rem 0.75rem;
}

.search-box {
  position: relative;
}

.search-input {
  width: 100%;
  height: 2.75rem;
  padding-left: 1rem;
  padding-right: 2.5rem;
  background: var(--gray-100);
  border: 0;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-800);
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--gray-400); }
.search-input:focus {
  background: var(--white);
  box-shadow: 0 0 0 2px var(--pink-500);
}

.search-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.search-clear:hover { color: var(--gray-700); }

/* --- Video Grid --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
}

@media (min-width: 640px) {
  .video-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.video-card {
  display: block;
  cursor: pointer;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-source-badge {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  border-radius: 4px;
}

.video-title {
  margin-top: 0.25rem;
  padding: 0 0.125rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.video-card:hover .video-title {
  color: var(--pink-700);
}

/* --- Bottom Nav --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 3rem;
}

.bottom-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.bottom-nav a:hover,
.bottom-nav a.active {
  color: var(--pink-700);
}

/* --- Buttons --- */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-action:hover { background: var(--gray-200); }

.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-more:hover { background: var(--gray-200); }

/* --- Tab Bar (source/category) --- */
.tab-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

.tab-bar-inner {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 0.5rem 0.75rem;
}
.tab-bar-inner::-webkit-scrollbar { display: none; }

.tab-item {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tab-item:hover { background: var(--gray-200); }
.tab-item.active {
  background: var(--pink-700);
  color: var(--white);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--pink-500); }
.breadcrumb-sep { color: var(--gray-300); }

/* --- Video Detail --- */
.detail-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-800);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}
.tag-pink { background: var(--pink-50); color: var(--pink-700); }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }

.detail-blurb {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
}

.pagination button {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pagination button:hover { background: var(--gray-100); }
.pagination button.active {
  background: var(--pink-700);
  color: var(--white);
  border-color: var(--pink-700);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Discover --- */
.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.hot-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 1.5rem;
}

.hot-searches a {
  font-size: 0.875rem;
  color: var(--gray-600);
  transition: color 0.2s;
}
.hot-searches a:hover { color: var(--pink-500); }
.hot-searches a.highlight {
  color: var(--pink-500);
  font-weight: 500;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem 0.5rem;
}

.category-grid a {
  text-align: center;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-radius: var(--radius);
  color: var(--gray-700);
  transition: all 0.2s;
}
.category-grid a:hover {
  color: var(--pink-500);
  background: var(--pink-50);
}

.divider {
  margin: 0 0.75rem;
  height: 1px;
  background: var(--gray-100);
}

/* --- Profile --- */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .domain-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .domain-grid { grid-template-columns: repeat(4, 1fr); }
}

.domain-card {
  display: block;
  padding: 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.domain-card:hover {
  border-color: var(--pink-200);
  background: var(--pink-50);
}
.domain-card .domain-name {
  font-size: 0.875rem;
  color: var(--gray-800);
  font-weight: 500;
}

.profile-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.profile-tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.profile-tab:hover { background: var(--gray-200); }
.profile-tab.active {
  background: var(--pink-700);
  color: var(--white);
  font-weight: 500;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--gray-200);
  border-radius: var(--radius);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
}
@media (min-width: 640px) {
  .skeleton-grid { grid-template-columns: repeat(4, 1fr); }
}
.skeleton-card {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
}

/* --- Empty / Error States --- */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.retry-btn:hover { background: var(--gray-200); }

/* --- Utility --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
