/* ==========================================================================
   Video Portal — Main Stylesheet
   Design: Light, modern, friendly
   Primary: #6C63FF | Accent: #FF6584 | Background: #F8F9FA
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary:         #6C63FF;
  --color-primary-dark:    #5A52D5;
  --color-primary-light:   #EAE8FF;
  --color-primary-alpha:   rgba(108, 99, 255, 0.15);
  --color-accent:          #FF6584;
  --color-accent-dark:     #E0506D;

  --color-bg:              #F8F9FA;
  --color-surface:         #FFFFFF;
  --color-border:          #DEE2E6;
  --color-border-light:    #F1F3F5;

  --color-text:            #212529;
  --color-text-muted:      #6C757D;
  --color-text-subtle:     #ADB5BD;

  --color-success:         #28A745;
  --color-success-bg:      #D4EDDA;
  --color-warning:         #856404;
  --color-warning-bg:      #FFF3CD;
  --color-danger:          #DC3545;
  --color-danger-bg:       #F8D7DA;
  --color-danger-border:   #f5c6cb;

  --color-badge-public-bg:     #D4EDDA;
  --color-badge-public-text:   #155724;
  --color-badge-unlisted-bg:   #FFF3CD;
  --color-badge-unlisted-text: #856404;
  --color-badge-private-bg:    #E9ECEF;
  --color-badge-private-text:  #495057;

  --color-thumb-bg:        #E9ECEF;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.25rem;
  --font-size-2xl:  1.5rem;
  --font-size-3xl:  1.875rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-xl:  0 16px 40px rgba(0, 0, 0, 0.14);

  /* Transitions */
  --transition-fast:  150ms ease;
  --transition-base:  200ms ease;
  --transition-slow:  400ms ease;

  /* Layout */
  --nav-height:     64px;
  --container-max:  1200px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Global: SVGs inside buttons and nav-links always behave as icons */
.btn svg,
.nav-link svg,
.share-btn svg,
.share-tab svg,
.alert svg,
.danger-zone-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------------------
   Layout & Containers
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-wide {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-content {
  min-height: calc(100vh - var(--nav-height) - 72px);
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 3rem;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  height: 100%;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
  fill: #fff;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
  white-space: nowrap;
  text-decoration: none;
}

.navbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
  height: 38px;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.btn-search {
  height: 38px;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background var(--transition-base), color var(--transition-base);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--color-border-light);
}

.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-avatar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: background var(--transition-base);
}

.navbar-toggle:hover {
  background: var(--color-border-light);
}

.navbar-mobile-menu {
  display: none;
}

.navbar-mobile-menu.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: 1rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-md);
  z-index: 999;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base),
              border-color var(--transition-base), box-shadow var(--transition-base),
              transform var(--transition-base);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-secondary {
  background: #E9ECEF;
  color: #495057;
  border-color: #E9ECEF;
}

.btn-secondary:hover {
  background: #dee2e6;
  border-color: #dee2e6;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: #b02a37;
  border-color: #b02a37;
}

.btn-warning {
  background: #f0ad4e;
  color: #fff;
  border-color: #f0ad4e;
}

.btn-warning:hover {
  background: #d9922a;
  border-color: #d9922a;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.form-label-link {
  font-weight: 400;
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.form-label-link:hover {
  text-decoration: underline;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-subtle);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.input-password-wrapper {
  position: relative;
}

.input-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-base);
}

.input-password-toggle:hover {
  color: var(--color-text);
}

.required-mark {
  color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--color-danger-bg);
  color: #721c24;
  border: 1px solid var(--color-danger-border);
}

.alert-list {
  margin: 0;
  padding-left: 1.25rem;
}

/* --------------------------------------------------------------------------
   Auth Pages
   -------------------------------------------------------------------------- */
.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  flex-shrink: 0;
}

.auth-logo svg {
  width: 32px;
  height: 32px;
  color: #fff;
  fill: #fff;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.divider span {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Video Grid & Cards
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.video-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.video-card-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-thumb-bg);
}

.thumbnail-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-thumb-bg);
}

.thumbnail-play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--color-primary);
  margin-left: 4px;
}

.thumbnail-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.video-card-body {
  padding: 1rem;
}

.video-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.video-card-title-link {
  color: inherit;
  text-decoration: none;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.video-card-author {
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

.video-card-author:hover {
  color: var(--color-primary);
}

.video-card-separator {
  color: var(--color-border);
}

.video-card-views,
.video-card-date {
  color: var(--color-text-muted);
}

/* Visibility Badges */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.visibility-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.visibility-public {
  background: var(--color-badge-public-bg);
  color: var(--color-badge-public-text);
}

.visibility-unlisted {
  background: var(--color-badge-unlisted-bg);
  color: var(--color-badge-unlisted-text);
}

.visibility-private {
  background: var(--color-badge-private-bg);
  color: var(--color-badge-private-text);
}

/* --------------------------------------------------------------------------
   Video Watch Page
   -------------------------------------------------------------------------- */
.video-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: flex-start;
}

.video-main {
  min-width: 0;
}

.player-wrapper {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.player-wrapper video,
.player-wrapper .video-js {
  width: 100%;
  height: 100%;
}

.video-info {
  margin-top: 1.25rem;
}

.video-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.video-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.video-views {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.video-views svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.views-count {
  font-weight: 600;
  color: var(--color-text);
}

.video-channel-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 1rem 0;
}

.channel-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--font-size-sm);
}

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

.channel-name {
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition-base);
  display: block;
}

.channel-name:hover {
  color: var(--color-primary);
}

.channel-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.video-share-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition: border-color var(--transition-base), color var(--transition-base),
              background var(--transition-base);
}

.share-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.video-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.video-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Sidebar */
.video-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1.25rem);
}

/* Edit Panel */
.video-edit-panel {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--color-border);
}

.edit-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: var(--font-size-base);
}

.edit-panel-title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edit-form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.edit-danger-zone {
  border-top: 1px solid rgba(220, 53, 69, 0.3);
  padding-top: 1rem;
  margin-top: 1rem;
}

.danger-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.danger-zone-title {
  color: var(--color-danger);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Share Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), color var(--transition-base);
}

.modal-close:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Share Tabs */
.share-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.share-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--color-text-muted);
  font-weight: 500;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  transition: color var(--transition-base), border-color var(--transition-base);
  margin-bottom: -1px;
}

.share-tab:hover {
  color: var(--color-text);
}

.share-tab.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}

.share-tabpanel {
  display: none;
}

.share-tabpanel.active {
  display: block;
}

.share-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.share-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.share-copy-row {
  display: flex;
  gap: 0.5rem;
}

.share-input,
.share-input-code {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  font-size: 0.85rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  font-family: var(--font-family);
}

.share-input-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.share-input[readonly],
.share-input-code[readonly] {
  cursor: default;
}

.btn-copy {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition-base), border-color var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-copy:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   Upload
   -------------------------------------------------------------------------- */
.upload-section {
  padding: 2rem 0;
}

.upload-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.upload-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.upload-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
  background: #FAFAFE;
}

.dropzone:hover,
.dropzone.dragover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-dark);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-icon svg {
  width: 48px;
  height: 48px;
}

.dropzone-text {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.dropzone-browse {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.dropzone-input {
  display: none;
}

.dropzone-preview > svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.dropzone-preview {
  display: none;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.dropzone-preview.visible {
  display: flex;
}

.dropzone-filename {
  font-weight: 600;
  font-size: var(--font-size-sm);
  word-break: break-all;
}

.dropzone-filesize {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.dropzone-clear {
  margin-left: auto;
  flex-shrink: 0;
}

/* Upload Progress */
/* --------------------------------------------------------------------------
   Storage Widget (Upload-Seite)
   -------------------------------------------------------------------------- */
.storage-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* Farbiger Akzentstreifen oben */
.storage-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.storage-widget--warning::before { background: #F59E0B; }
.storage-widget--danger::before  { background: var(--color-danger); }

/* Header: Icon + Titel + Prozent */
.storage-widget-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.storage-widget-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.storage-widget--warning .storage-widget-icon {
  background: #FEF3C7;
  color: #D97706;
}

.storage-widget--danger .storage-widget-icon {
  background: #FEE2E2;
  color: var(--color-danger);
}

.storage-widget-icon svg {
  width: 20px;
  height: 20px;
}

.storage-widget-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.storage-widget-label {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-text);
}

.storage-widget-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.storage-widget-percent {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.storage-widget--warning .storage-widget-percent { color: #D97706; }
.storage-widget--danger  .storage-widget-percent { color: var(--color-danger); }

/* Fortschrittsbalken */
.storage-progress-track {
  height: 10px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1rem;
}

.storage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #8B85FF);
  border-radius: var(--radius-full);
  position: relative;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

.storage-widget--warning .storage-progress-fill {
  background: linear-gradient(90deg, #F59E0B, #FCD34D);
}

.storage-widget--danger .storage-progress-fill {
  background: linear-gradient(90deg, var(--color-danger), #F87171);
}

/* Glanz-Effekt auf dem Balken */
.storage-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
}

/* Stat-Kacheln */
.storage-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.storage-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.storage-stat--center {
  text-align: center;
  align-items: center;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.storage-stat--right {
  text-align: right;
  align-items: flex-end;
}

.storage-stat-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.storage-stat-value--danger {
  color: var(--color-danger);
}

.storage-stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.upload-progress {
  margin-top: 1rem;
  display: none;
}

.upload-progress-bar {
  background: var(--color-border);
  border-radius: var(--radius-sm);
  height: 8px;
  overflow: hidden;
}

.upload-progress-fill {
  background: var(--color-primary);
  height: 100%;
  border-radius: var(--radius-sm);
  width: 0;
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   My Videos Table
   -------------------------------------------------------------------------- */
.table-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  background: var(--color-bg);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-base);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--color-bg);
}

.data-table td {
  padding: 1rem;
  vertical-align: middle;
}

.table-video-title {
  font-weight: 600;
}

.col-visibility {
  width: 110px;
}

.col-views {
  width: 90px;
}

.col-filesize {
  width: 110px;
  white-space: nowrap;
}

.col-date {
  width: 130px;
}

.col-actions {
  width: 120px;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Channel Page
   -------------------------------------------------------------------------- */
.channel-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.channel-header-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.channel-header-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.channel-header-label {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.channel-header-count {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.channel-body {
  padding: 1rem 0;
}

/* --------------------------------------------------------------------------
   Similar Videos Sidebar
   -------------------------------------------------------------------------- */
.similar-videos {
  display: flex;
  flex-direction: column;
}

.similar-videos-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.similar-videos-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.similar-video-item {
  display: flex;
  gap: 0.75rem;
}

.similar-video-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 0.75rem;
  width: 100%;
  transition: opacity var(--transition-base);
}

.similar-video-link:hover {
  opacity: 0.8;
}

.similar-video-thumbnail,
.thumbnail-placeholder-sm {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-thumb-bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.similar-video-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.similar-video-author {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.similar-video-views,
.similar-video-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color var(--transition-base), color var(--transition-base),
              background var(--transition-base);
}

.pagination-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-prev,
.pagination-next {
  width: auto;
  padding: 0 1rem;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  height: 40px;
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 64px;
  height: 64px;
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.empty-state-text {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Section Header (Homepage)
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Error Page
   -------------------------------------------------------------------------- */
.error-page {
  text-align: center;
  padding: 6rem 2rem;
}

.error-body {
  max-width: 480px;
  margin: 0 auto;
}

.error-code-display {
  font-size: 8rem;
  font-weight: 900;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 0;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.error-message {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Embed Page
   -------------------------------------------------------------------------- */
.embed-player-wrapper {
  position: fixed;
  inset: 0;
  background: #000;
}

.embed-player-wrapper video,
.embed-player-wrapper .video-js {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #F1F3F5;
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
}

.footer-inner {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Avatar Badge (Nav)
   -------------------------------------------------------------------------- */
.avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition-base);
}

.avatar-badge:hover {
  opacity: 0.85;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   Channel Avatar Image
   -------------------------------------------------------------------------- */
.channel-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.channel-header-description {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  line-height: 1.5;
  max-width: 60ch;
}

.channel-edit-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.channel-edit-btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Avatar Upload (Channel-Edit-Modal)
   -------------------------------------------------------------------------- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.avatar-upload-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.avatar-upload-letter {
  line-height: 1;
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.avatar-file-input {
  display: none;
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.avatar-upload-btn svg {
  width: 16px;
  height: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Responsive — 1024px
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .video-layout {
    grid-template-columns: 1fr;
  }

  .video-sidebar {
    position: static;
  }

  .similar-videos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Responsive — 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .navbar-search {
    display: none;
  }

  /* Hide text nav links; keep upload button and avatar */
  .navbar-actions .nav-link:not(.nav-link--upload) {
    display: none;
  }

  .navbar-toggle {
    display: flex;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .channel-header {
    flex-direction: column;
    text-align: center;
  }

  .channel-header-info {
    text-align: center;
  }

  .edit-form-actions {
    flex-direction: column;
  }

  .edit-form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .similar-videos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .video-title {
    font-size: 1.25rem;
  }

  .data-table thead th,
  .data-table td {
    padding: 0.75rem 0.625rem;
  }

  .col-date,
  .col-views {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive — 480px
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    box-shadow: none;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
  }

  .share-copy-row {
    flex-direction: column;
  }

  .share-copy-row .btn-copy {
    width: 100%;
    justify-content: center;
  }

  .video-share-row {
    flex-direction: column;
  }

  .video-share-row .share-btn {
    width: 100%;
    justify-content: center;
  }

  .page-header-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .error-code-display {
    font-size: 5rem;
  }

  .error-title {
    font-size: 1.5rem;
  }

  .modal-dialog {
    padding: 1.5rem 1.25rem;
  }

  .upload-card {
    padding: 1.25rem;
  }

  .dropzone {
    padding: 2rem 1rem;
  }

  .channel-header {
    padding: 1.5rem 0;
    gap: 1rem;
  }

  .channel-header-name {
    font-size: 1.4rem;
  }
}

/* --------------------------------------------------------------------------
   Utility — visually hidden (a11y)
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
