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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #e4e6eb;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  width: 100%;
  max-width: 600px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #0866FF, #A033FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #8a8d91;
  font-size: 14px;
}

/* Search Box */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #2d2d3a;
  background: #16161e;
  color: #e4e6eb;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #0866FF;
}

.search-box input::placeholder {
  color: #5a5d63;
}

.search-box button {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0866FF, #A033FF);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.search-box button:hover {
  opacity: 0.9;
}

.search-box button:active {
  transform: scale(0.97);
}

.search-box button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Error */
.error {
  background: #2d1215;
  border: 1px solid #5c2b2e;
  color: #f87171;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Result Card */
.result-card {
  background: #16161e;
  border: 1px solid #2d2d3a;
  border-radius: 16px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

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

.result-header {
  display: flex;
  gap: 16px;
  padding: 20px;
}

.thumbnail-wrap {
  position: relative;
  flex-shrink: 0;
}

.thumbnail-wrap img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  background: #2d2d3a;
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-info h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e4e6eb;
}

.desc {
  font-size: 13px;
  color: #8a8d91;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.publish-date {
  font-size: 12px;
  color: #6b6e73;
  margin-top: 8px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #2d2d3a;
  border-top: 1px solid #2d2d3a;
}

.stat-item {
  background: #16161e;
  padding: 20px 12px;
  text-align: center;
  transition: background 0.2s;
}

.stat-item:hover {
  background: #1c1c26;
}

.stat-icon {
  margin-bottom: 8px;
  color: #5a5d63;
}

.stat-item.views .stat-icon { color: #0866FF; }
.stat-item.likes .stat-icon { color: #F0284A; }
.stat-item.comments .stat-icon { color: #45BD62; }
.stat-item.shares .stat-icon { color: #A033FF; }

.stat-value {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-item.views .stat-value { color: #0866FF; }
.stat-item.likes .stat-value { color: #F0284A; }
.stat-item.comments .stat-value { color: #45BD62; }
.stat-item.shares .stat-value { color: #A033FF; }

.stat-label {
  font-size: 11px;
  color: #8a8d91;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Footer */
.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid #2d2d3a;
}

.result-footer a {
  color: #0866FF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

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

.video-id {
  font-size: 12px;
  color: #5a5d63;
  font-family: monospace;
}

/* History */
.history {
  margin-top: 32px;
}

.history h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #8a8d91;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #16161e;
  border: 1px solid #2d2d3a;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.history-item:hover {
  border-color: #0866FF;
}

.history-author {
  font-size: 14px;
  font-weight: 500;
}

.history-views {
  font-size: 13px;
  color: #0866FF;
  font-weight: 600;
}

.history-time {
  font-size: 11px;
  color: #5a5d63;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #2d2d3a;
  padding-bottom: 0;
}

.tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #8a8d91;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: #e4e6eb; }
.tab.active { color: #0866FF; border-bottom-color: #0866FF; }

/* Auth Banner */
.auth-banner.warning {
  background: #2d2615;
  border: 1px solid #5c4a1e;
  color: #fbbf24;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Auth Status */
.auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #16161e;
  border: 1px solid #2d2d3a;
  border-radius: 10px;
}

.auth-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #5a5d63;
  flex-shrink: 0;
}
.auth-dot.auth-ok { background: #4CAF50; }
.auth-dot.auth-no { background: #f44336; }

#authText { font-size: 14px; flex: 1; }

.btn-login {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: #0866FF;
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-login:hover { opacity: 0.9; }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* Profile Form */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-form input[type="text"] {
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #2d2d3a;
  background: #16161e;
  color: #e4e6eb;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.profile-form input[type="text"]:focus { border-color: #0866FF; }
.profile-form input[type="text"]::placeholder { color: #5a5d63; }

.date-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range input[type="date"] {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #2d2d3a;
  background: #16161e;
  color: #e4e6eb;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.date-range input[type="date"]:focus { border-color: #0866FF; }
.date-sep { color: #5a5d63; font-size: 14px; }

.btn-scan {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0866FF, #A033FF);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-scan:hover { opacity: 0.9; }
.btn-scan:active { transform: scale(0.97); }
.btn-scan:disabled { opacity: 0.6; cursor: not-allowed; }

/* Progress Bar */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #2d2d3a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0866FF, #A033FF);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0;
}

#progressText {
  font-size: 13px;
  color: #8a8d91;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* Reels Table */
.reels-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}

.reels-table thead th {
  text-align: left;
  padding: 10px 12px;
  color: #8a8d91;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2d2d3a;
}

.reels-table tbody tr {
  border-bottom: 1px solid #1e1e28;
  transition: background 0.15s;
}
.reels-table tbody tr:hover { background: #1c1c26; }

.reels-table td {
  padding: 10px 12px;
  color: #e4e6eb;
}

.reels-table td a {
  color: #0866FF;
  text-decoration: none;
  font-weight: 500;
}
.reels-table td a:hover { text-decoration: underline; }

.reels-table td.date-cell {
  color: #6b6e73;
  font-size: 12px;
  white-space: nowrap;
}

/* Scan Summary */
.scan-summary {
  background: #16161e;
  border: 1px solid #2d2d3a;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.scan-summary h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #8a8d91;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  text-align: center;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #e4e6eb;
}

.summary-label {
  font-size: 11px;
  color: #8a8d91;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 480px) {
  body { padding: 20px 12px; }
  .logo h1 { font-size: 22px; }
  .search-box { flex-direction: column; }
  .search-box button { padding: 14px; }
  .result-header { flex-direction: column; align-items: center; text-align: center; }
  .thumbnail-wrap img { width: 200px; height: 260px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 18px; }
  .date-range { flex-direction: column; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .reels-table { font-size: 12px; }
  .reels-table td, .reels-table th { padding: 8px 6px; }
}
