/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

/* Color Variables */
:root {
  --primary-color: #FCB040;        /* SSL Amber Yellow */
  --primary-light: #FFDDA6;
  --secondary-color: #52B0C6;      /* SSL soft Cyan/Teal */
  --secondary-light: #C2EDF6;
  --secondary-dark: #378EAE;
  --text-dark: #2D2D2D;            /* SSL Charcoal body text */
  --text-muted: #666666;
  --bg-main: #F4F8FA;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(82, 176, 198, 0.25);
  --accent-peach: #FFBC7D;
  --accent-blue: #00AEEF;
  --accent-red: #FF5A5F;
  
  --font-title: 'Fredoka', 'Comic Sans MS', cursive;
  --font-header: 'Outfit', 'Lato', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 20%, rgba(252, 176, 64, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(82, 176, 198, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(255, 188, 125, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 700;
  color: var(--text-dark);
}

.brand-font {
  font-family: var(--font-title);
}

/* Common UI Elements */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  flex-wrap: wrap;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo img {
  height: 40px;
  width: auto;
}

.logo-dot {
  color: var(--primary-color);
}

.logo-sub {
  color: var(--secondary-color);
}

.user-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  background: var(--secondary-light);
  color: var(--secondary-dark);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.user-badge.role-editor {
  background: var(--primary-light);
  color: #c97100;
}

.btn-logout {
  background: none;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 10px rgba(255, 90, 95, 0.25);
}

.btn-admin-link {
  background: none;
  border: 1px solid var(--primary-color, #52b0c6);
  color: var(--primary-color, #52b0c6);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-admin-link:hover {
  background: var(--primary-color, #52b0c6);
  color: #fff;
}

.btn-danger {
  background: none;
  border: 1px solid var(--accent-red, #e05252);
  color: var(--accent-red, #e05252);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-danger:hover {
  background: var(--accent-red, #e05252);
  color: #fff;
}

.btn-sm {
  padding: 5px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* Admin page */
.admin-back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 4px;
}

.admin-back-link:hover { color: var(--text-dark); }

.admin-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.admin-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.role-badge.role-editor {
  background: var(--primary-light, #fff3da);
  color: #c97100;
}

.role-badge.role-client {
  background: var(--secondary-light, #e8f7fa);
  color: var(--secondary-dark, #2a8fa8);
}

.pin-display {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-page, #f5f7fa);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--text-dark);
  min-width: 90px;
  text-align: center;
}

/* Authentication Lock Screen Gate */
#auth-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(244, 248, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-logo {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

.auth-section {
  width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.auth-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.auth-select, .auth-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 176, 198, 0.4);
  background: #fff;
  font-size: 15px;
  color: var(--text-dark);
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-select:focus, .auth-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(82, 176, 198, 0.25);
}

.create-profile-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--secondary-dark);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.create-profile-link:hover {
  text-decoration: underline;
}

/* Keypad Display */
.keypad-display-wrapper {
  margin: 16px 0 20px 0;
  width: 100%;
}

.keypad-display {
  background: #fff;
  border: 1px solid rgba(82, 176, 198, 0.3);
  border-radius: var(--radius-sm);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  letter-spacing: 8px;
  font-weight: 700;
  color: var(--text-dark);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.keypad-display span {
  display: inline-block;
  animation: keyPop 0.1s ease;
}

@keyframes keyPop {
  0% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

/* Keypad Grid */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.keypad-btn {
  background: #fff;
  border: 1px solid rgba(82, 176, 198, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
  font-family: var(--font-header);
}

.keypad-btn:hover {
  background: var(--secondary-light);
  border-color: var(--secondary-color);
  color: var(--secondary-dark);
  transform: translateY(-1px);
}

.keypad-btn:active {
  background: var(--secondary-color);
  color: #fff;
  transform: translateY(1px);
}

.keypad-btn.btn-clear {
  color: var(--accent-red);
}

.keypad-btn.btn-clear:hover {
  background: rgba(255, 90, 95, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.keypad-btn.btn-clear:active {
  background: var(--accent-red);
  color: #fff;
}

.keypad-btn.btn-submit {
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.keypad-btn.btn-submit:hover {
  background: var(--secondary-color);
  color: #fff;
}

.auth-error {
  color: var(--accent-red);
  font-size: 14px;
  margin-top: 14px;
  min-height: 20px;
  font-weight: 500;
}

/* Dashboard Style */
.dashboard-hero {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
  color: #fff;
  padding: 50px 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: rgba(252, 176, 64, 0.3);
  border-radius: 50%;
  z-index: 1;
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 10%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: 1;
}

.dashboard-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.dashboard-hero h1 {
  font-family: var(--font-title);
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: #fff;
}

.dashboard-hero p {
  font-size: 17px;
  opacity: 0.9;
  max-width: 600px;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-dark);
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(252, 176, 64, 0.35);
  transition: all 0.25s ease;
  font-family: var(--font-header);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 176, 64, 0.5);
  background: #ffbe57;
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Video Grid */
.section-title {
  font-family: var(--font-title);
  font-size: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title-line {
  flex-grow: 1;
  height: 2px;
  background: rgba(82, 176, 198, 0.2);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(82, 176, 198, 0.6);
  background: var(--bg-card-hover);
}

.video-thumbnail-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000;
  overflow: hidden;
}

.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail {
  transform: scale(1.05);
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.video-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.video-card-meta {
  display: flex;
  gap: 16px;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.section-title-row .section-title {
  margin-bottom: 24px;
  flex: 1;
}

.btn-toggle-archived {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 4px;
}

.btn-toggle-archived:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.video-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-card:hover .video-card-actions {
  opacity: 1;
}

.btn-card-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-body);
}

.btn-card-archive:hover {
  border-color: var(--secondary-color);
  background: var(--secondary-light);
  color: var(--secondary-dark);
}

.btn-card-delete:hover {
  border-color: var(--accent-red);
  background: rgba(255, 90, 95, 0.08);
  color: var(--accent-red);
}

.video-card--archived {
  opacity: 0.65;
  filter: grayscale(0.4);
}

.video-card--archived:hover {
  opacity: 0.85;
  filter: grayscale(0);
}

.video-archived-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-icon-bubble {
  color: var(--secondary-color);
}

.meta-icon-section {
  color: var(--primary-color);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(82, 176, 198, 0.3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--secondary-color);
  opacity: 0.7;
  margin-bottom: 16px;
}

/* Modal styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(45, 45, 45, 0.5);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  padding: 30px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

.btn-secondary {
  background: #e2ecf0;
  color: var(--text-dark);
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #cbdfe6;
}

/* Collaboration Page Workspace Layout */
.collab-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  margin-top: 30px;
  margin-bottom: 60px;
}

@media (max-width: 1024px) {
  .collab-layout {
    grid-template-columns: 1fr;
  }
}

.collab-left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Video Player section */
.video-player-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  position: relative;
}

.video-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Timelines Module */
.timelines-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-track-wrapper {
  position: relative;
}

.timeline-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-title.timeline-client {
  color: var(--secondary-dark);
}

.timeline-version-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-select {
  height: 26px;
  padding: 0 22px 0 8px;
  border-radius: 50px;
  border: 1px solid var(--secondary-color);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2352B0C6'/%3E%3C/svg%3E") no-repeat right 7px center;
  background-size: 8px;
  color: var(--secondary-dark);
  font-family: var(--font-header);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  appearance: none;
  -webkit-appearance: none;
  max-width: 120px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.version-select:focus {
  outline: none;
  border-color: var(--secondary-dark);
  box-shadow: 0 0 0 3px rgba(82, 176, 198, 0.2);
}

.timeline-version-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--secondary-color);
  background: #fff;
  color: var(--secondary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.timeline-version-btn:hover:not(:disabled) {
  background: var(--secondary-color);
  color: #fff;
  transform: translateY(-1px);
}

.timeline-version-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-version-delete:hover:not(:disabled) {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.timeline-title.timeline-editor {
  color: var(--primary-color);
}

.timeline-time-display {
  font-size: 12px;
  font-weight: 600;
  font-family: monospace;
  color: var(--text-muted);
  margin-left: auto;
}

.timeline-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-add-section-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--primary-color);
  background: #fff;
  color: var(--primary-color);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.timeline-add-section-btn:hover {
  background: var(--primary-color);
  color: var(--text-dark);
  transform: translateY(-1px);
}

.timeline-auto-adjust-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--primary-color);
  background: #fff;
  color: var(--primary-color);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.timeline-auto-adjust-btn:hover {
  background: var(--primary-color);
  color: var(--text-dark);
  transform: translateY(-1px);
}

/* Timeline Track Base */
.timeline-track {
  height: 12px;
  background: rgba(82, 176, 198, 0.15);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-click-zone {
  height: 22px;
  cursor: crosshair;
}

.timeline-progress {
  height: 100%;
  background: var(--secondary-color);
  border-radius: 6px;
  width: 0%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.timeline-playhead {
  width: 16px;
  height: 16px;
  background: #fff;
  border: 3px solid var(--secondary-color);
  border-radius: 50%;
  position: absolute;
  top: -2px;
  left: 0%;
  transform: translateX(-50%);
  cursor: grab;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  transition: transform 0.1s ease;
  z-index: 10;
}

.pending-comment-marker {
  display: none;
  width: 14px;
  height: 14px;
  background: var(--primary-color);
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: -1px;
  left: 0;
  transform: translateX(-50%);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  z-index: 12;
}

.pending-comment-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: 2px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 2px;
}

.timeline-track:hover .timeline-playhead {
  transform: translateX(-50%) scale(1.2);
}

/* Client Timeline 1 Markers */
.comment-marker {
  position: absolute;
  top: 14px; /* Render arrows pointing up underneath the track */
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid var(--secondary-dark);
  transform: translateX(-50%);
  cursor: pointer;
  transition: transform 0.2s ease, border-bottom-color 0.2s ease;
  z-index: 5;
}

.comment-marker:hover {
  transform: translateX(-50%) scale(1.3);
  border-bottom-color: var(--primary-color);
}

.comment-marker.active {
  border-bottom-color: var(--primary-color);
  transform: translateX(-50%) scale(1.4);
  z-index: 6;
}

/* Editor Timeline 2 Sections */
.timeline-track-editor {
  height: 24px;
  background: rgba(45, 45, 45, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
}

.timeline-empty-message {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.timeline-section-block {
  height: 100%;
  position: absolute;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  cursor: grab;
  transition: filter 0.2s ease, opacity 0.2s ease;
  background-color: var(--secondary-color);
  min-width: 22px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  touch-action: none;
  line-height: 1;
}

.timeline-section-block:nth-child(even) {
  background-color: var(--primary-color);
  color: var(--text-dark);
  text-shadow: none;
}

.timeline-section-block:hover {
  filter: brightness(1.08);
}

.timeline-section-block.active {
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 10px rgba(0,0,0,0.2);
  filter: brightness(1.15);
  z-index: 5;
}

.timeline-section-block.resizing {
  filter: brightness(1.12);
  z-index: 8;
}

.timeline-section-block.moving {
  cursor: grabbing;
  filter: brightness(1.12);
  z-index: 8;
}

.timeline-section-block.client-view {
  cursor: pointer;
  touch-action: manipulation; /* Allow taps; don't block click events */
}

.section-block-label {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 9px;
  line-height: 1;
}

.section-label-prefix,
.section-label-number {
  display: inline-block;
  line-height: 1;
}

.timeline-section-block.section-compact .section-label-prefix {
  display: none;
}

.timeline-section-block.section-compact .section-block-label {
  padding: 0 4px;
}

.timeline-section-block.section-tiny .section-block-label {
  width: 100%;
  padding: 0;
  font-size: 9px;
  transform: translateY(0);
}

.timeline-section-block.section-tiny .section-label-number {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.section-resize-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 2;
}

.section-resize-handle::after {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
}

.section-resize-start {
  left: 0;
}

.section-resize-start::after {
  left: 3px;
}

.section-resize-end {
  right: 0;
}

.section-resize-end::after {
  right: 3px;
}

.timeline-resizing,
.timeline-resizing * {
  cursor: ew-resize !important;
  user-select: none !important;
}

.timeline-moving,
.timeline-moving * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* Collab Right Sidebar Panel */
.collab-right-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: max-content;
}

/* Tab Layout for Right Sidebar */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-family: var(--font-header);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(82, 176, 198, 0.35);
  background: #fff;
  color: var(--secondary-dark);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.panel-body.collapsed {
  display: none;
}

.section-notes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-section-note-tool {
  background: #fff;
  border: 1px solid rgba(82, 176, 198, 0.45);
  color: var(--secondary-dark);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-section-note-tool:hover {
  background: var(--secondary-light);
  border-color: var(--secondary-color);
}

.panel-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.9);
}

/* Video Comments Feed (Timeline 1) */
.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-bubble {
  background: #fff;
  border: 1px solid rgba(82, 176, 198, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.comment-bubble:hover {
  border-color: var(--secondary-color);
  box-shadow: var(--shadow-sm);
}

.comment-bubble.active {
  border-color: var(--primary-color);
  background: rgba(252, 176, 64, 0.05);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.comment-author {
  font-weight: 700;
  color: var(--text-dark);
}

.comment-timestamp {
  font-weight: 600;
  color: var(--secondary-dark);
  cursor: pointer;
  background: var(--secondary-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.comment-timestamp:hover {
  background: var(--secondary-color);
  color: #fff;
}

.comment-text {
  color: var(--text-dark);
  word-break: break-word;
}

.comment-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  font-size: 14px;
}

.comment-bubble:hover .comment-delete-btn {
  opacity: 0.6;
}

.comment-bubble:hover .comment-delete-btn:hover {
  opacity: 1;
  color: var(--accent-red);
}

/* Comment actions bar (Reply button) */
.comment-actions-bar {
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(82, 176, 198, 0.1);
}

.reply-toggle-btn {
  background: none;
  border: none;
  color: var(--secondary-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

.reply-toggle-btn:hover {
  opacity: 1;
  color: var(--secondary-color);
}

/* Reply thread */
.comment-replies-thread {
  margin: 8px 0 0 0;
  padding: 8px 0 0 0;
  border-top: 1px solid rgba(82, 176, 198, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-reply {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.reply-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.reply-body {
  flex: 1;
  min-width: 0;
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.reply-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dark);
}

.reply-time {
  font-size: 10px;
  color: var(--text-muted);
}

.reply-text {
  font-size: 12px;
  color: var(--text-dark);
  word-break: break-word;
  line-height: 1.4;
}

.reply-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  padding: 0 2px;
  transition: opacity 0.15s, color 0.15s;
  margin-left: auto;
}

.comment-reply:hover .reply-delete-btn {
  opacity: 0.6;
}

.comment-reply:hover .reply-delete-btn:hover {
  opacity: 1;
  color: var(--accent-red);
}

/* Inline reply composer */
.comment-reply-composer {
  margin-top: 8px;
}

.reply-textarea {
  width: 100%;
  border: 1px solid rgba(82, 176, 198, 0.3);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  color: var(--text-dark);
  background: #fafcfd;
}

.reply-textarea:focus {
  border-color: var(--secondary-color);
  background: #fff;
}

.reply-composer-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

.reply-cancel-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.reply-cancel-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-dark);
}

.reply-submit-btn {
  background: var(--secondary-color);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
}

.reply-submit-btn:hover {
  background: var(--secondary-dark);
}

/* Comment Input Area */
.comment-input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-textarea {
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 176, 198, 0.4);
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.comment-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.active-time-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.active-time-label span {
  font-family: monospace;
  font-size: 13px;
  color: var(--secondary-dark);
  background: var(--secondary-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Section Notes Panel */
.section-notes-panel {
  border-top: 1px solid var(--border-color);
}

.section-notes-toolbar {
  min-height: 58px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-notes-toolbar h3 {
  font-family: var(--font-header);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-details-box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 18px 0 0 0;
  min-height: 120px;
  position: relative;
}

.section-title-label {
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rich-text-toolbar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  background: var(--bg-card, #fff);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-dark);
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.rte-btn:hover {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.12);
}

.rte-btn.rte-active {
  background: rgba(82, 176, 198, 0.18);
  border-color: rgba(82, 176, 198, 0.5);
  color: var(--accent, #52b0c6);
}

.rte-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: rgba(0,0,0,0.12);
  margin: 0 4px;
}

.section-notes-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dark);
  user-select: text;
  position: relative;
  min-height: 140px;
  padding: 4px 0 24px;
  border-radius: var(--radius-sm);
}

/* Rich text content styles inside notes */
.section-notes-content h2 {
  font-size: 1.1em;
  font-weight: 700;
  margin: 0.6em 0 0.2em;
}

.section-notes-content ul,
.section-notes-content ol {
  margin: 0.3em 0 0.3em 1.4em;
  padding: 0;
}

.section-notes-content li {
  margin: 0.15em 0;
}

.section-notes-content p {
  margin: 0.2em 0;
}

.section-notes-content.is-editable {
  cursor: text;
}

.section-notes-content.is-editable:focus {
  outline: none;
  box-shadow: inset 3px 0 0 rgba(82, 176, 198, 0.45);
  padding-left: 10px;
}

.section-notes-content.is-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.note-line {
  min-height: 24px;
}

.note-inline-composer {
  background: #fff;
  border: 1px solid rgba(252, 176, 64, 0.55);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.note-inline-composer .comment-textarea {
  min-height: 76px;
  font-size: 13px;
}

.note-inline-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.note-inline-composer-actions .btn-primary,
.note-inline-composer-actions .btn-secondary {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.note-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  margin: 2px 0;
  white-space: normal;
}

.note-checklist-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  accent-color: var(--secondary-color);
  flex: 0 0 auto;
}

.note-checklist-item span {
  line-height: 1.5;
}

.note-indent-1 { padding-left: 18px; }
.note-indent-2 { padding-left: 36px; }
.note-indent-3 { padding-left: 54px; }
.note-indent-4 { padding-left: 72px; }
.note-indent-5 { padding-left: 90px; }
.note-indent-6 { padding-left: 108px; }

.section-notes-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Selection Highlight Styles */
.highlighted-comment-span {
  background-color: var(--secondary-light);
  border-bottom: 2px solid var(--secondary-color);
  cursor: pointer;
  transition: background-color 0.2s;
  padding: 1px 0;
  position: relative;
}

.highlighted-comment-wrap {
  display: inline;
}

.highlighted-comment-span.has-asset {
  background-color: rgba(82, 176, 198, 0.18);
  border-bottom-color: #2FA866;
}

.highlight-asset-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  border-radius: 50%;
  background: #2FA866;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 1px;
}

.highlight-asset-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #2FA866;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}

.highlighted-comment-span:hover, .highlighted-comment-span.active {
  background-color: var(--primary-light);
  border-bottom-color: var(--primary-color);
}

/* Floating Comment Trigger */
.floating-comment-trigger {
  position: fixed;
  z-index: 9999;
  background: var(--primary-color);
  color: var(--text-dark);
  border: none;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  animation: popIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: all;
}

@keyframes popIn {
  from { transform: scale(0.6) translateY(4px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.floating-comment-trigger:hover {
  background: #ffc266;
  box-shadow: var(--shadow-lg);
}

/* Text Highlight Comments Section */
.highlight-comments-container {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.note-comments-panel-body {
  max-height: 360px;
}

.highlight-comments-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.highlight-comment-item {
  background: #fff;
  border-left: 3px solid var(--secondary-color);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
}

.highlight-comment-item:hover {
  background: rgba(82, 176, 198, 0.1);
}

.highlight-comment-item.active {
  border-left-color: var(--primary-color);
  background: rgba(252, 176, 64, 0.08);
}

.highlight-comment-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.highlight-comment-summary-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text-dark);
}

.highlight-comment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(82, 176, 198, 0.18);
  color: var(--secondary-dark);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.highlight-comment-file-pill {
  padding: 1px 5px;
  border-radius: 4px;
  background: #2FA866;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  flex: 0 0 auto;
}

.highlight-comment-item.has-asset .highlight-comment-status {
  background: #2FA866;
  color: #fff;
}

.highlight-comment-detail {
  margin-top: 8px;
}

.highlight-comment-item.collapsed .highlight-comment-detail {
  display: none;
}

.highlight-quote {
  font-style: italic;
  color: var(--text-muted);
  border-left: 2px solid rgba(0,0,0,0.1);
  padding-left: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.highlight-asset-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(47, 168, 102, 0.1);
  color: #247A4D;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.highlight-asset-link:hover {
  background: rgba(47, 168, 102, 0.18);
}

.asset-upload-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.asset-upload-input {
  width: 100%;
  font-size: 13px;
}

/* Uploaded Assets Library */
.asset-library-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.asset-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.asset-library-header h3 {
  font-family: var(--font-header);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.asset-library-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.asset-library-grid {
  display: grid;
  gap: 14px;
}

.asset-library-empty {
  min-height: 72px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.asset-section-group {
  display: grid;
  gap: 8px;
}

.asset-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-dark);
}

.asset-section-heading span:last-child {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.asset-thumb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.asset-thumb-card {
  min-width: 0;
  color: var(--text-dark);
  text-decoration: none;
}

.asset-thumb-preview {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f6fafb;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-thumb-preview img,
.asset-thumb-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-file-preview {
  min-width: 52px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: rgba(82, 176, 198, 0.16);
  color: var(--secondary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.asset-thumb-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.asset-thumb-type {
  font-size: 10px;
  font-weight: 800;
  color: var(--secondary-dark);
}

.asset-thumb-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.asset-thumb-note {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Editor Action Controls */
.editor-controls {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.editor-controls h3 {
  font-family: var(--font-header);
  font-size: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-actions-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-editor-action {
  background: #fff;
  border: 1px solid var(--primary-color);
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-editor-action:hover {
  background: var(--primary-color);
  color: var(--text-dark);
}

/* Section Editor Form */
.section-form-row {
  display: grid;
  grid-template-columns: 90px 28px 90px 1fr;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}

.section-form-row input {
  padding: 8px;
  border: 1px solid rgba(82, 176, 198, 0.3);
  border-radius: 4px;
  font-size: 13px;
  width: 100%;
}

.section-form-row input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.section-form-row span {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.section-notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid rgba(82, 176, 198, 0.3);
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 15px;
}

.section-list-editor {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(0,0,0,0.05);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  background: rgba(0,0,0,0.01);
}

.section-editor-item {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.section-editor-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}

.toast {
  background: #2D2D2D;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlideIn {
  from { transform: translateY(20px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast.success {
  border-left: 4px solid var(--secondary-color);
}

.toast.error {
  border-left: 4px solid var(--accent-red);
}

@media (max-width: 900px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    height: 56px;
    min-height: 56px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Hide desktop controls, show hamburger */
  .header-desktop-controls { display: none; }
  .hamburger-wrapper { display: flex; align-items: center; gap: 8px; }

  /* Collab video title — smaller on mobile */
  #collab-video-title {
    font-size: 20px !important;
    margin-bottom: 14px !important;
  }

  /* Show mobile quick-comment strip */
  .mobile-quick-comment { display: block; }

  .dashboard-hero {
    padding: 32px 0;
    margin-bottom: 28px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  .dashboard-hero h1 {
    font-size: 34px;
  }

  .dashboard-hero p {
    font-size: 15px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .modal-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 18px 14px;
  }

  .modal-container {
    padding: 22px;
    max-height: none;
  }

  .collab-layout {
    gap: 20px;
    margin-top: 18px;
  }

  .timelines-container {
    padding: 18px;
  }

  .timeline-label-row,
  .section-title-label,
  .comment-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .panel-body {
    max-height: none;
  }

  .btn-row {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .btn-row button,
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .section-form-row {
    grid-template-columns: 1fr 28px 1fr;
  }

  .section-title-input {
    grid-column: 1 / -1;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    width: 100%;
    border-radius: var(--radius-sm);
  }

  /* Collab: timeline horizontal scroll on mobile */
  .timeline-track-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .timeline-track {
    min-width: 480px;
  }

  /* Collab: larger touch targets for timeline controls */
  .timeline-label-row button,
  .btn-section-note-tool,
  .btn-add-section {
    min-height: 38px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Rich text toolbar wraps on small screens */
  .rich-text-toolbar {
    gap: 4px;
    padding: 6px;
  }

  .rte-btn {
    min-width: 32px;
    height: 32px;
  }

  /* Section notes panel */
  .section-notes-panel {
    margin-top: 0;
  }

  .section-notes-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-notes-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Collab right panel - full width below left panel */
  .collab-right-panel {
    width: 100%;
  }

  /* Version controls */
  #version-select {
    max-width: 100%;
    width: 100%;
  }

  .video-controls-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Admin table becomes cards on mobile */
  .admin-table thead { display: none; }
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }
  .admin-table td {
    padding: 5px 0;
    border: none;
  }
  .admin-table-actions {
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 4px;
  }

  /* Auth card - tighter on small screens */
  .auth-card {
    padding: 28px 20px;
    margin: 12px;
  }
}

/* ─── Hamburger menu ─── */
.header-desktop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hamburger-wrapper {
  display: none;
  position: relative;
  align-items: center;
  gap: 8px;
}

.hamburger-name {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 15px;
  color: var(--primary-color);
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}

.nav-dropdown.open { display: block; }

.nav-dropdown-user {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-light);
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-dropdown-item:hover { background: var(--bg-light); }
.nav-dropdown-logout { color: var(--error-color, #e53e3e); }

/* ─── Mobile quick-comment widget ─── */
.mobile-quick-comment {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.mobile-quick-comment-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.mobile-quick-comment-label strong {
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

.mobile-comment-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  margin-bottom: 10px;
  display: block;
}

.mobile-comment-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* ─── Extra-small phones (≤ 480px) ─── */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .logo {
    font-size: 20px;
  }

  /* Dashboard hero tighter */
  .dashboard-hero h1 {
    font-size: 26px;
  }

  .dashboard-hero p {
    font-size: 14px;
  }

  /* Video card actions stack */
  .video-card-actions {
    flex-direction: column;
    gap: 8px;
  }

  .video-card-actions a,
  .video-card-actions button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Collab: simplify toolbar layout */
  .timelines-container {
    padding: 12px;
  }

  .section-notes-content {
    font-size: 14px;
  }

  /* Keypad larger tap targets */
  .keypad-num-btn {
    min-height: 50px;
    font-size: 20px;
  }

  /* Panel headers */
  .panel-header h3 {
    font-size: 14px;
  }

  /* Comment composer */
  .comment-composer textarea {
    font-size: 15px;
  }

  /* Admin page */
  .pin-display {
    font-size: 18px;
    padding: 6px 14px;
  }

  .admin-back-link {
    font-size: 13px;
  }
}
