/* ================================================================
   AmaVideos — Main Stylesheet
   /assets/css/main.css
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Colors */
  --bg:          #0f0f0f;
  --bg-2:        #161616;
  --bg-3:        #1e1e1e;
  --bg-4:        #252525;
  --surface:     #1a1a1a;
  --surface-2:   #222222;
  --border:      rgba(255,255,255,0.08);
  --border-2:    rgba(255,255,255,0.14);

  --accent:      #e63946;
  --accent-dark: #c1121f;
  --accent-glow: rgba(230, 57, 70, 0.18);

  --text:        #f0f0f0;
  --text-2:      #b0b0b0;
  --text-3:      #707070;
  --text-inv:    #ffffff;

  --success:     #2dc653;
  --warning:     #f4a261;
  --error:       #e63946;
  --info:        #4cc9f0;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --gap:   24px;
  --gap-s: 12px;
  --gap-l: 48px;

  /* Radius */
  --r:    8px;
  --r-l:  14px;
  --r-xl: 20px;

  /* Transitions */
  --t: 0.2s ease;
  --t-s: 0.12s ease;

  /* Shadows */
  --shadow:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-l: 0 12px 48px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 24px rgba(230, 57, 70, 0.25);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  transition: opacity var(--t);
}
.nav-logo:hover { opacity: 0.85; }

.nav-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.nav-search input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 42px 9px 18px;
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t), background var(--t);
}
.nav-search input:focus {
  outline: none;
  border-color: var(--border-2);
  background: var(--bg-4);
}
.nav-search input::placeholder { color: var(--text-3); }
.nav-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  transition: color var(--t);
}
.nav-search-btn:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  transition: background var(--t), color var(--t);
}
.nav-notif-btn:hover { background: var(--bg-3); color: var(--text); }
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--t);
}
.nav-avatar:hover { border-color: var(--accent); }

/* Nav dropdown */
.nav-user {
  position: relative;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-l);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-l);
  z-index: 200;
  animation: dropdown-in 0.15s ease;
}
.nav-user:hover .nav-dropdown,
.nav-user:focus-within .nav-dropdown { display: block; }
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-dropdown a, .nav-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 14px;
  color: var(--text-2);
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--t), color var(--t);
}
.nav-dropdown a:hover, .nav-dropdown button:hover {
  background: var(--bg-3);
  color: var(--text);
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.nav-dropdown .logout-btn { color: var(--accent); }

/* Mobile menu toggle */
.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all var(--t);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-4);
  border-color: var(--border-2);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text);
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.form-label span.req { color: var(--accent); margin-left: 2px; }
.form-control {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-4);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-3); }
.form-control.error { border-color: var(--error); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 2px;
}

/* Password toggle wrapper */
.input-wrap {
  position: relative;
}
.input-wrap .form-control { padding-right: 44px; }
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  transition: color var(--t);
}
.toggle-pw:hover { color: var(--text); }

/* ── Flash Messages ──────────────────────────────────────── */
.flash { border-radius: var(--r); padding: 12px 16px; font-size: 14px; margin-bottom: 20px; border-left: 3px solid; }
.flash-success { background: rgba(45,198,83,0.1);  border-color: var(--success); color: #5ce87d; }
.flash-error   { background: rgba(230,57,70,0.1);  border-color: var(--error);   color: #ff6b78; }
.flash-info    { background: rgba(76,201,240,0.1); border-color: var(--info);    color: #7dd9f5; }
.flash-warning { background: rgba(244,162,97,0.1); border-color: var(--warning); color: #f7bb80; }

/* ── Video Cards ─────────────────────────────────────────── */
.video-grid {
  display: grid;
  gap: var(--gap);
}
.video-grid.layout-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.video-grid.layout-card {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.video-grid.layout-list {
  grid-template-columns: 1fr;
}

.video-card {
  background: var(--surface);
  border-radius: var(--r-l);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.video-card a { display: block; }

/* Thumbnail */
.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.04); }
.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
}
.video-age-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Card body */
.video-card-body {
  padding: 14px;
  display: flex;
  gap: 10px;
}
.video-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.video-card-info { flex: 1; min-width: 0; }
.video-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.video-card-channel {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-card-channel:hover { color: var(--text); }
.video-card-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.video-card-meta span + span::before {
  content: ' · ';
}

/* List layout variant */
.video-grid.layout-list .video-card {
  display: flex;
  flex-direction: row;
}
.video-grid.layout-list .video-thumb {
  width: 260px;
  flex-shrink: 0;
  aspect-ratio: auto;
  height: 148px;
}
.video-grid.layout-list .video-card-body {
  flex: 1;
  align-items: flex-start;
  padding: 16px;
}
.video-grid.layout-list .video-card-title { font-size: 15px; -webkit-line-clamp: 3; }

/* ── Sections ────────────────────────────────────────────── */
.section { padding: var(--gap-l) 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap);
}
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.section-title span { color: var(--accent); }
.section-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--t);
}
.section-link:hover { opacity: 0.8; }

/* ── Container ───────────────────────────────────────────── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-sm { max-width: 760px; }
.container-xs { max-width: 480px; }

/* ── Category Bar ────────────────────────────────────────── */
.category-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar-inner {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: max-content;
  min-width: 100%;
}
.category-pill {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
  text-decoration: none;
}
.category-pill:hover { color: var(--text); }
.category-pill.active {
  color: var(--text);
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.page-subtitle { font-size: 15px; color: var(--text-2); }

/* ── Auth Layout ─────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
/* Background decoration */
.auth-wrap::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230,57,70,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-wrap::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(230,57,70,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: card-rise 0.4s ease;
}
.auth-card-wide { max-width: 560px; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.5px;
  display: block;
  margin-bottom: 28px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-subtitle { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-3);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
  margin-top: 24px;
}
.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--t);
}
.auth-footer a:hover { opacity: 0.8; }

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-primary { background: var(--accent-glow); color: var(--accent); }
.badge-success { background: rgba(45,198,83,0.12); color: var(--success); }
.badge-info    { background: rgba(76,201,240,0.12); color: var(--info); }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px; height: 32px; }
.avatar-md  { width: 44px; height: 44px; }
.avatar-lg  { width: 72px; height: 72px; }
.avatar-xl  { width: 100px; height: 100px; border: 3px solid var(--border); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 0;
}
.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
}
.page-btn:hover { background: var(--bg-4); color: var(--text); border-color: var(--border-2); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled, .page-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Utility ─────────────────────────────────────────────── */
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-3); }
.text-center   { text-align: center; }
.font-display  { font-family: var(--font-display); }
.font-bold     { font-weight: 700; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Skeleton Loader ─────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--t);
}
.footer-links a:hover { color: var(--text-2); }
.footer-copy {
  font-size: 12px;
  color: var(--text-3);
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-search { display: none; }
  .nav-menu-btn { display: flex; }
  .video-grid.layout-grid,
  .video-grid.layout-card {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  .video-card-title { font-size: 13px; }
  .video-grid.layout-list .video-thumb { width: 140px; height: 90px; }
  .auth-card { padding: 28px 24px; }
  .video-grid.layout-list .video-card { flex-direction: column; }
  .video-grid.layout-list .video-thumb { width: 100%; height: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .video-grid.layout-grid,
  .video-grid.layout-card {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .video-card-body { padding: 10px; }
  .video-card-avatar { width: 28px; height: 28px; }
}
