/**
 * FightVault Stylesheet
 * Modern, Sleek, Minimalist Material Design
 */

:root {
  /* Dark Theme Palette */
  --primary-color: #bb86fc;
  --primary-variant: #3700b3;
  --secondary-color: #03dac6;
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --error-color: #cf6679;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-on-primary: #000000;

  /* Spacing & Layout */
  --border-radius: 12px;
  --spacing-unit: 8px;
  --container-width: 1200px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Roboto",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  background-color: var(--surface-color);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 40px;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.user-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.user-info strong {
  color: var(--text-primary);
}

/* Main Content */
.app-main {
  padding-bottom: 60px;
}

.welcome-section {
  margin-bottom: 40px;
}

.welcome-section h2 {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-primary);
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: none;
  border-radius: 24px; /* Pill shape */
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-variant);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid #333;
}

.btn-secondary:hover {
  background-color: #333;
  color: var(--text-primary);
  border-color: #555;
}

.btn-danger {
  background-color: var(--error-color);
  color: white;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.video-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.video-card:hover .video-thumbnail img {
  opacity: 1;
}

.video-thumbnail a {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  backdrop-filter: blur(4px);
  transition: transform 0.2s;
}

.video-card:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--primary-color);
}

.video-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-info h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.video-meta .edit-btn {
  margin-left: auto;
}

.video-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.video-type.instructional {
  background-color: rgba(63, 81, 181, 0.2);
  color: #90caf9;
  border: 1px solid rgba(144, 202, 249, 0.3);
}

.video-type.footage {
  background-color: rgba(216, 67, 21, 0.2);
  color: #ffab91;
  border: 1px solid rgba(255, 171, 145, 0.3);
}

.added-by {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.field-error {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--border-color);
}

.page-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-ellipsis {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  user-select: none;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  margin-top: 12px;
  height: 34px;
  overflow: hidden;
}

.video-timestamps {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  background: #252525;
  padding: 10px;
  border-radius: 8px;
  white-space: pre-wrap; /* Preserve newlines */
}

.timestamp-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.timestamp-link:hover {
  text-decoration: underline;
}

.tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: #2c2c2c;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #333;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-notes {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 0;
}

.modal-content {
  background-color: var(--surface-color);
  margin: 0 auto;
  padding: 32px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  position: absolute;
  right: 24px;
  top: 24px;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: var(--text-primary);
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background: #2c2c2c;
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #333;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.1);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInDown 0.3s ease-out;
}

.alert-error {
  background-color: rgba(207, 102, 121, 0.15);
  color: #ffb4ab; /* Lighter error color for dark text */
  border: 1px solid rgba(207, 102, 121, 0.5);
  border-left: 4px solid var(--error-color);
}

.alert-error::before {
  content: "⚠️";
  font-size: 1.2rem;
}

.alert-success {
  background-color: rgba(3, 218, 198, 0.15);
  color: #80ffe8; /* Lighter success color */
  border: 1px solid rgba(3, 218, 198, 0.5);
  border-left: 4px solid var(--secondary-color);
}

.alert-success::before {
  content: "✅";
  font-size: 1.2rem;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Pages Specific */
.auth-box {
  background: var(--surface-color);
  padding: 48px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}

.auth-box h1 {
  color: var(--primary-color);
  margin-bottom: 8px;
}

.auth-box h2 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 400;
}

.auth-link {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

/* Hide mobile greeting on desktop */
.account-dropdown-section.mobile-greeting {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .app-header h1 {
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .app-header nav {
    margin-left: auto;
    flex-shrink: 0;
  }

  .account-menu {
    flex: 0 0 auto;
  }

  /* Hamburger: hide all text, show ☰ icon */
  .account-trigger {
    width: 44px;
    height: 44px;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .account-trigger strong,
  .account-trigger .role-badge,
  .account-caret {
    display: none !important;
  }

  .account-trigger::before {
    content: "\2630";
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-primary);
  }

  /* Show greeting inside dropdown on mobile */
  .account-dropdown-section.mobile-greeting {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
  }

  .account-dropdown {
    right: 0;
    left: auto;
    min-width: 220px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 24px;
    width: 95%;
  }

  .pricing-cards {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    width: 100%;
    max-width: 360px;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  /* Search input and button: full width on mobile */
  .search-row .search-bar-container,
  .search-row .btn {
    width: 100%;
  }
}

/* Filter Section Styles */
.filter-section {
  background: var(--surface-color);
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.search-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.search-bar-container {
  position: relative;
  flex-grow: 1;
}

.search-bar-container input {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid #333;
  border-radius: 24px;
  background: #2c2c2c;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s;
}

.search-bar-container input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.1);
}

.search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--surface-color);
  border: 1px solid #333;
  border-radius: 8px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.suggestion-item {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: #333;
}

.filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px; /* Increased margin */
}

.type-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.filter-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: var(--secondary-color);
  color: #000;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.remove-filter {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.remove-filter:hover {
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tag Hover Effect */
.tag {
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
}

.video-type {
  cursor: pointer;
  transition: opacity 0.2s;
}

.video-type:hover {
  opacity: 0.8;
}

/* Video Player Overlay */
.video-player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.video-player-modal {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  border: 1px solid #333;
  animation: scaleIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.video-player-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  background: #252525;
  position: relative;
}

.video-player-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 20px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.close-player-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.close-player-btn:hover {
  color: var(--text-primary);
}

.video-frame-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: #000;
}

.video-frame-container iframe,
#ytPlayerContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#ytPlayerContainer iframe {
  width: 100%;
  height: 100%;
}

/* Player Details Section */
.player-details-section {
  background: #252525;
  border-top: 1px solid #333;
}

.toggle-details-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition:
    background 0.2s,
    color 0.2s;
  text-align: center;
}

.toggle-details-btn:hover {
  background: #333;
  color: var(--text-primary);
}

.player-details-content {
  padding: 20px;
  border-top: 1px solid #333;
  max-height: 300px;
  overflow-y: auto;
}

.player-timestamps {
  margin-bottom: 16px;
  white-space: pre-wrap;
  font-family: monospace;
  color: var(--text-secondary);
}

.player-notes {
  color: var(--text-primary);
  line-height: 1.5;
}

/* Shortcuts Info Button */
.shortcuts-info-btn {
  background: none;
  border: 1px solid #444;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.shortcuts-info-btn:hover,
.shortcuts-info-btn.active {
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
}

/* Shortcuts Popover */
.shortcuts-popover {
  position: absolute;
  top: 100%;
  right: 16px;
  background: #2c2c2c;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 20px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-width: 280px;
  animation: fadeIn 0.2s ease;
}

.shortcuts-popover h4 {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shortcut-row span {
  margin-left: auto;
  color: var(--text-secondary);
}

.shortcut-row kbd {
  background: #1a1a1a;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.8rem;
  font-family: "Roboto Mono", monospace;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
  line-height: 1.4;
}

.shortcuts-hint {
  margin: 12px 0 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  font-style: italic;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #616161;
}

/* Firefox Support */
* {
  scrollbar-width: thin;
  scrollbar-color: #424242 transparent;
}

.forgot-password {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  margin-top: 8px;
  color: var(--primary-color);
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* ─── Role Badges ─────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 6px;
  vertical-align: middle;
}

.role-admin {
  background: linear-gradient(135deg, #bb86fc, #7c4dff);
  color: #fff;
}

.role-paid {
  background: linear-gradient(135deg, #03dac6, #018786);
  color: #000;
}

.role-unpaid {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

/* ─── Upgrade Banner ──────────────────────────────────── */
.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(187, 134, 252, 0.12),
    rgba(3, 218, 198, 0.08)
  );
  border: 1px solid rgba(187, 134, 252, 0.3);
  border-radius: var(--border-radius);
  padding: 12px 20px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.upgrade-banner .btn {
  flex-shrink: 0;
}

/* ─── Search Limit Bar (unpaid users) ────────────────── */
.search-limit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 0 2px;
}

.search-limit-bar.search-limit-exhausted {
  color: var(--error-color);
}

.search-limit-upgrade {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-limit-upgrade:hover {
  text-decoration: underline;
}

/* ─── Upgrade / Pricing Page ──────────────────────────── */
.upgrade-page {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 16px;
  text-align: center;
}

.upgrade-hero {
  margin-bottom: 48px;
}

.upgrade-lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.upgrade-hero h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.upgrade-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.pricing-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.pricing-card {
  background: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 32px 28px;
  width: 280px;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pricing-card-featured {
  border-color: var(--primary-color);
  box-shadow:
    0 0 0 1px var(--primary-color),
    var(--shadow-lg);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-amount {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.price-period {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan-features li {
  font-size: 0.88rem;
  line-height: 1.4;
}

.feature-included {
  color: var(--text-primary);
}

.feature-excluded {
  color: var(--text-secondary);
  opacity: 0.5;
}

.feature-note {
  font-size: 0.78rem;
  opacity: 0.65;
  font-style: italic;
}

.plan-btn {
  width: 100%;
  text-align: center;
}

.current-plan {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.coming-soon-note {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: -8px;
}

/* ── Account Menu Dropdown ───────────────────────────────────────────────── */
.account-menu {
  position: relative;
  display: inline-block;
}

.account-trigger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  font-size: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.account-trigger:hover {
  background: rgba(255, 255, 255, 0.07);
}

.account-caret {
  font-size: 0.6rem;
  opacity: 0.6;
  margin-left: 0.15rem;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  background: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 999;
  overflow: hidden;
}

.account-dropdown-section {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.account-dropdown-section:last-child {
  border-bottom: none;
}

.dropdown-logout-btn {
  display: block;
  width: 100%;
  padding: 0.4rem 0;
  color: #e85d5d;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.dropdown-logout-btn:hover {
  color: #ff7070;
  text-decoration: underline;
}

.account-plan-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.account-plan-type {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.account-plan-expires {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.account-cancel-btn {
  width: 100%;
  margin-top: 0.25rem;
}

.text-warning {
  color: #f0a500;
}
.text-muted {
  color: var(--text-secondary);
}

/* ─── Landing / Welcome Page ─────────────────────────────────────────────── */

.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.landing-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.landing-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Hero */
.landing-hero {
  text-align: center;
  padding: 100px 20px 80px;
}

.landing-hero-title {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.text-accent {
  color: var(--primary-color);
}

.landing-hero-subtitle {
  max-width: 540px;
  margin: 0 auto 40px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.landing-hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
}

/* Features */
.landing-features {
  padding: 80px 20px;
}

.landing-section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 56px;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius);
  padding: 32px 28px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* CTA Section */
.landing-cta {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(180deg, transparent, rgba(187, 134, 252, 0.04));
}

.landing-cta h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.landing-cta p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

/* Footer */
.landing-footer {
  padding: 32px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.landing-footer-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Demo Videos Section */
.landing-demos {
  padding: 80px 20px;
  background: linear-gradient(180deg, rgba(187, 134, 252, 0.03), transparent);
}

.demos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.demo-card {
  background: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.demo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.demo-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  cursor: pointer;
}

.demo-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.demo-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition:
    background 0.2s,
    transform 0.2s,
    opacity 0.3s;
  z-index: 2;
}

.demo-play-btn:hover {
  background: var(--primary-color);
  transform: translate(-50%, -50%) scale(1.1);
}

.demo-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 20px 24px 6px;
}

.demo-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 0 24px 24px;
}

/* Landing responsive */
@media (max-width: 768px) {
  .landing-hero {
    padding: 64px 20px 48px;
  }

  .landing-hero-title {
    font-size: 2rem;
  }

  .landing-hero-subtitle {
    font-size: 1rem;
  }

  .features-grid,
  .demos-grid {
    grid-template-columns: 1fr;
  }

  .landing-features,
  .landing-demos,
  .landing-cta {
    padding: 48px 20px;
  }
}

/* ─── Tab Navigation ──────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 2px solid #2a2a2a;
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─── Folders Section ─────────────────────────────────────────────────────── */
.folders-header {
  margin-bottom: 24px;
}

.folders-search-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.folder-card {
  background: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius);
  padding: 24px 20px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 16px;
}

.folder-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.folder-icon {
  flex-shrink: 0;
  color: var(--primary-color);
  opacity: 0.85;
}

.folder-card-info {
  min-width: 0;
  flex: 1;
}

.folder-card-info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.folder-card-info span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.show-more-container {
  text-align: center;
  padding: 24px 0 8px;
}

/* ─── Folder Detail View ──────────────────────────────────────────────────── */
.folder-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.folder-detail-header h2 {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-detail-actions {
  display: flex;
  gap: 8px;
}

/* ─── Folder Picker (modal list) ──────────────────────────────────────────── */
.folder-picker-list {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 12px;
}

.folder-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.folder-picker-item:hover {
  background: #333;
}

.folder-picker-item.already-saved {
  opacity: 0.5;
  cursor: default;
}

.folder-picker-item .folder-picker-icon {
  flex-shrink: 0;
  color: var(--primary-color);
}

.folder-picker-item .folder-picker-check {
  margin-left: auto;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

/* ─── Favorite (Heart) Button on Video Cards ──────────────────────────────── */
.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.favorite-btn svg {
  width: 20px;
  height: 20px;
  transition:
    fill 0.2s,
    stroke 0.2s;
}

.favorite-btn .heart-outline {
  stroke: var(--text-secondary);
  fill: none;
}

.favorite-btn .heart-filled {
  display: none;
  fill: var(--error-color);
  stroke: var(--error-color);
}

.favorite-btn.is-favorited .heart-outline {
  display: none;
}

.favorite-btn.is-favorited .heart-filled {
  display: block;
}

/* ─── Remove from folder button ───────────────────────────────────────────── */
.remove-from-folder-btn {
  background: none;
  border: 1px solid #444;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.remove-from-folder-btn:hover {
  border-color: var(--error-color);
  color: var(--error-color);
}

/* ─── Loading spinner ────────────────────────────────────────────────────── */
.count-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #444;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-style: italic;
  padding: 12px 0;
}

/* ─── Folders responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .folders-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .folder-grid {
    grid-template-columns: 1fr;
  }

  .folder-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
