/* ═══════════════════════════════════════
   TORYNADO'S — Shared App Styles
   Matches landing page design language
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --rust: #C45D3E;
  --rust-light: #E8734F;
  --rust-dark: #A04830;
  --sand: #F5E6D3;
  --dark: #1A1714;
  --dark-mid: #2C2620;
  --dark-card: #332D26;
  --cream: #FDF8F3;
  --dust: #B8A898;
  --green-accent: #4A7C59;
  --green-light: #5A9C6E;
  --red: #D44;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--cream);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--rust-light); text-decoration: none; }
a:hover { color: var(--cream); }

/* ── NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(26, 23, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(184, 168, 152, 0.08);
}

.nav-brand {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--rust-light);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--dust);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--cream);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark-mid);
  border: 2px solid var(--rust);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--rust-light);
  cursor: pointer;
  overflow: hidden;
}

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

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--rust);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--rust-light);
  color: white;
}

.btn-secondary {
  background: var(--dark-mid);
  color: var(--cream);
  border: 1px solid rgba(184, 168, 152, 0.15);
}
.btn-secondary:hover {
  border-color: var(--rust);
}

.btn-ghost {
  background: transparent;
  color: var(--dust);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--cream);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

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

/* ── FORMS ── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dust);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--dark);
  border: 1px solid rgba(184, 168, 152, 0.15);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--rust);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(184, 168, 152, 0.4);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B8A898' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-error {
  background: rgba(212, 68, 68, 0.1);
  border: 1px solid rgba(212, 68, 68, 0.3);
  color: #F88;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ── CARDS ── */
.card {
  background: var(--dark-mid);
  border: 1px solid rgba(184, 168, 152, 0.08);
  border-radius: var(--radius);
  padding: 32px;
}

/* ── VIDEO CARD ── */
.video-card {
  background: var(--dark-mid);
  border: 1px solid rgba(184, 168, 152, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 93, 62, 0.3);
}

.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--dark-card);
  overflow: hidden;
}

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

.video-card-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(196, 93, 62, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-card:hover .play-icon {
  opacity: 1;
}

.video-card-body {
  padding: 16px;
}

.video-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--dust);
}

.video-card-meta .author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-card-meta .author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dark-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--rust-light);
  overflow: hidden;
}

.video-card-meta .author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(196, 93, 62, 0.15);
  color: var(--rust-light);
  letter-spacing: 0.5px;
}

/* ── CATEGORY PILLS ── */
.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid rgba(184, 168, 152, 0.15);
  background: transparent;
  color: var(--dust);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab:hover {
  border-color: var(--rust);
  color: var(--cream);
}
.cat-tab.active {
  background: var(--rust);
  border-color: var(--rust);
  color: white;
}

/* ── VIDEO GRID ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ── PAGE LAYOUTS ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--dust);
  font-size: 16px;
}

/* ── AUTH LAYOUT ── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 32px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--dust);
  font-size: 15px;
  margin-bottom: 32px;
}

.auth-card .alt-action {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--dust);
}

/* ── PROFILE ── */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--dark-mid);
  border: 3px solid var(--rust);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--rust-light);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.profile-info .username {
  color: var(--rust-light);
  font-size: 15px;
  margin-bottom: 8px;
}

.profile-info .bio {
  color: var(--dust);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.profile-info .location {
  color: var(--dust);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-stats {
  display: flex;
  gap: 32px;
  margin: 24px 0;
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--rust-light);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--dust);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── VEHICLE CARDS ── */
.vehicle-card {
  background: var(--dark-mid);
  border: 1px solid rgba(184, 168, 152, 0.08);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.vehicle-card-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--dark-card);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

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

.vehicle-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.vehicle-card p {
  font-size: 13px;
  color: var(--dust);
}

.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ── SECTION TABS ── */
.section-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(184, 168, 152, 0.1);
  margin-bottom: 24px;
}

.section-tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dust);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.section-tab:hover { color: var(--cream); }
.section-tab.active {
  color: var(--rust-light);
  border-bottom-color: var(--rust-light);
}

/* ── UPLOAD AREA ── */
.upload-zone {
  border: 2px dashed rgba(184, 168, 152, 0.2);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(184, 168, 152, 0.02);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--rust);
  background: rgba(196, 93, 62, 0.05);
}

.upload-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.upload-zone-text {
  font-size: 16px;
  color: var(--dust);
  margin-bottom: 8px;
}

.upload-zone-hint {
  font-size: 13px;
  color: rgba(184, 168, 152, 0.5);
}

.upload-preview {
  display: none;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-card);
  aspect-ratio: 16/9;
}

.upload-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-preview .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── WATCH PAGE ── */
.watch-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

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

.watch-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.watch-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.watch-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(184, 168, 152, 0.1);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.watch-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watch-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--rust-light);
  overflow: hidden;
}

.watch-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.watch-description {
  color: var(--dust);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
}

/* ── EMPTY STATES ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--dust);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 24px;
}

/* ── LOADING ── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(196, 93, 62, 0.2);
  border-top-color: var(--rust-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 4px;
  background: var(--dark-card);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-fill {
  height: 100%;
  background: var(--rust-light);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--dark-mid);
  border: 1px solid rgba(184, 168, 152, 0.15);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-size: 14px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--green-accent);
}

.toast.error {
  border-color: var(--red);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .navbar {
    padding: 12px 16px;
  }
  .nav-links {
    gap: 12px;
  }
  .page-container {
    padding: 20px 16px;
  }
  .card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .category-tabs {
    gap: 8px;
  }
}
