/* ═══════════════════════════════════════
   ViralHunt — Exact Match Design
   ═══════════════════════════════════════ */

:root {
  --black: #111111;
  --gray-800: #333333;
  --gray-600: #666666;
  --gray-500: #888888;
  --gray-400: #aaaaaa;
  --gray-300: #cccccc;
  --gray-200: #e0e0e0;
  --gray-150: #eaeaea;
  --gray-100: #f5f5f5;
  --gray-50: #fafafa;
  --white: #ffffff;
  --green: #22c55e;
  --red: #ef4444;
  --red-light: #fee2e2;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-150);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--black);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Crosshair — медленное вращение */
.logo-crosshair {
  animation: slowSpin 8s linear infinite;
  color: var(--black);
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.header-nav { display: flex; align-items: center; gap: 14px; }
.nav-section { display: flex; align-items: center; gap: 14px; }

.user-email {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

.search-counter {
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-dark {
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  padding: 11px 28px;
  border-radius: 50px;
}

.btn-dark:hover {
  background: var(--gray-800);
}

.btn-gray {
  background: #b0b0b0;
  color: var(--white);
  font-size: 15px;
  padding: 14px 36px;
  border-radius: var(--radius);
}

.btn-gray:hover {
  background: #999999;
}

.btn-full {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 40px 0;
  text-align: center;
}

.hero-title {
  font-family: 'Soyuz Grotesk Bold', 'Inter', sans-serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--black);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--gray-400);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 50px;
}

/* ═══════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════ */
.search-bar {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 6px;
}

.search-input-wrap {
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font);
  font-size: 15px;
  border: none;
  background: transparent;
  color: var(--black);
  outline: none;
}

.search-input::placeholder {
  color: var(--gray-300);
}

.filter-select {
  padding: 14px 36px 14px 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-left: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  white-space: nowrap;
}

.btn-search {
  border-radius: 10px;
  margin: 0;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   PLACEHOLDER (начальное состояние)
   ═══════════════════════════════════════ */
.placeholder-section {
  text-align: center;
  padding: 100px 20px 80px;
}

.placeholder-icon {
  font-size: 42px;
  margin-bottom: 16px;
}

.placeholder-crosshair {
  animation: slowSpin 8s linear infinite;
}

.placeholder-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
}

.placeholder-sub {
  font-size: 14px;
  color: var(--gray-400);
  display: block;
  margin-top: 6px;
}

/* ═══════════════════════════════════════
   LOADING
   ═══════════════════════════════════════ */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-500);
  font-size: 14px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════ */
.results-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.results-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.results-count {
  font-size: 14px;
  color: var(--gray-400);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* ═══════════════════════════════════════
   VIDEO CARD
   ═══════════════════════════════════════ */
.video-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.video-card:hover {
  border-color: var(--gray-300);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.card-cover {
  position: relative;
  aspect-ratio: 9/12;
  background: var(--gray-100);
  overflow: hidden;
  cursor: pointer;
}

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

.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-300);
  font-size: 13px;
}

.card-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.card-cover:hover .card-play-btn { opacity: 1; }

.viral-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-body { padding: 14px; }

.card-description {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 36px;
}

.card-author {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.card-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  min-height: 22px;
}

.hashtag {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-600);
}

.stat svg {
  width: 13px;
  height: 13px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.stat-value { font-weight: 700; }

/* Viral Bar */
.viral-bar-wrap { margin-bottom: 12px; }

.viral-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 5px;
}

.viral-bar-label span:last-child {
  font-weight: 700;
  color: var(--green);
}

.viral-bar {
  height: 5px;
  background: var(--gray-100);
  border-radius: 10px;
  overflow: hidden;
}

.viral-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.btn-download {
  width: 100%;
  padding: 10px;
  font-size: 12px;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-download:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ═══════════════════════════════════════
   NO RESULTS
   ═══════════════════════════════════════ */
.no-results {
  text-align: center;
  padding: 100px 20px;
}

/* ═══════════════════════════════════════
   LIMIT
   ═══════════════════════════════════════ */
.limit-message {
  display: flex;
  justify-content: center;
  padding: 80px 20px;
}

.limit-card {
  text-align: center;
  padding: 48px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  max-width: 440px;
}

.limit-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 8px 0;
}

.limit-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--black); }

.modal-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font);
  font-size: 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--black); }
.form-input::placeholder { color: var(--gray-300); }

.form-error {
  background: var(--red-light);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.modal-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 20px;
}

.modal-footer-text a {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}

.modal-footer-text a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1200px) {
  .results-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { font-size: 38px; }
}

@media (max-width: 720px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }

  .search-bar {
    flex-direction: column;
    gap: 0;
  }

  .search-input-wrap { width: 100%; }

  .filter-select {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--gray-200);
  }

  .btn-search {
    width: 100%;
    margin-top: 6px;
  }

  .hero {
    padding: 50px 20px 0;
  }

  .hero-title {
    font-size: 28px;
    letter-spacing: -0.5px;
  }

  .hero-subtitle { font-size: 14px; }

  .results-section { padding: 30px 20px 60px; }
  .header-inner { padding: 0 20px; }
  .user-email { display: none; }
}

@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr; }
}
