/* CSS Reset & Variables */
:root {
  --bg-app: #08090c;
  --bg-sidebar: #0f1115;
  --bg-card: rgba(22, 28, 38, 0.45);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-hover: #4f46e5;
  --accent: #14b8a6; /* Teal */
  --accent-glow: rgba(20, 184, 166, 0.15);
  --danger: #ef4444;
  --success: #10b981;

  --text-main: #f3f4f6;
  --text-semi: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-lg: 0 12px 48px 0 rgba(0, 0, 0, 0.5);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Main Layout Structure */
.app-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  gap: 28px;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px var(--primary));
}

.logo h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.tagline {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  padding-left: 42px;
}

/* Sync Form styling */
.sync-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sync-section h3,
.channels-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-semi);
  margin-bottom: 8px;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.limit-selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.limit-selector-wrapper label {
  font-size: 11px;
  color: var(--text-muted);
}

.limit-selector-wrapper select {
  width: 100%;
  padding: 8px 10px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-semi);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 12px;
  cursor: pointer;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.primary-btn {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

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

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

.sync-status {
  font-size: 11px;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  white-space: pre-line;
  font-family: var(--font-mono), monospace;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

.sync-status.info {
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-semi);
}

.sync-status.success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.sync-status.error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Channels List */
.channels-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.channels-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.channels-list li:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.channels-list li.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
  box-shadow: inset 0 0 8px rgba(99, 102, 241, 0.1);
}

.channels-list li img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #333;
}

.loading-item {
  color: var(--text-muted);
  font-style: italic;
  justify-content: center;
  cursor: default !important;
}

.loading-item:hover {
  transform: none !important;
  background: none !important;
  border-color: var(--border-glass) !important;
}

/* Main Content Panel */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 40px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 600px),
              radial-gradient(circle at bottom left, rgba(20, 184, 166, 0.03), transparent 600px);
}

/* Empty State */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
}

.empty-state-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-main);
}

.empty-state p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 14px;
}

/* Dashboard States */
.dashboard-state {
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.4s ease-out;
}

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

/* Channel Header Banner */
.channel-header-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-glass);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.channel-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--primary-glow) 0%, transparent 100%);
  opacity: 0.3;
  z-index: 1;
}

.channel-profile-details {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 2;
}

.channel-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  background-color: rgba(255, 255, 255, 0.05);
}

.channel-text-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-text-info h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.channel-handle {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.channel-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-semi);
}

.stat-pill strong {
  color: #fff;
  font-weight: 600;
}

/* Stats Overview Grid */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

.metric-icon-bg {
  font-size: 28px;
  opacity: 0.8;
}

/* Tabs */
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  gap: 8px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

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

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Controls Panel */
.controls-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  gap: 12px;
  max-width: 450px;
  flex: 1;
  transition: var(--transition);
}

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

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  background: none;
  border: none;
  color: var(--text-main);
  outline: none;
  width: 100%;
  font-size: 14px;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.select-wrapper select {
  padding: 10px 14px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  color: var(--text-semi);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.select-wrapper select:focus {
  border-color: var(--primary);
}

.view-toggle-btns {
  display: flex;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-btn {
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.toggle-btn:hover {
  color: var(--text-main);
}

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

.toggle-icon {
  width: 18px;
  height: 18px;
}

/* Videos Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.videos-grid.hidden {
  display: none !important;
}

/* Video Card */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  backdrop-filter: blur(12px);
}

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

.card-media-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.2);
}

.card-media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .card-media-wrapper img {
  transform: scale(1.05);
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 500;
  color: #fff;
  z-index: 2;
}

/* Rank Badges */
.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 30px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.rank-badge.rank-1 {
  background: linear-gradient(45deg, #f59e0b, #d97706); /* Gold */
  border: 1px solid #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.rank-badge.rank-2 {
  background: linear-gradient(45deg, #94a3b8, #64748b); /* Silver */
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.3);
}

.rank-badge.rank-3 {
  background: linear-gradient(45deg, #b45309, #78350f); /* Bronze */
  border: 1px solid #d97706;
  box-shadow: 0 0 12px rgba(180, 83, 9, 0.3);
}

.rank-badge.rank-other {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-details h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

.card-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  padding-top: 10px;
  margin-top: auto;
}

.card-views {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text-semi);
}

.card-date {
  font-size: 11px;
}

/* Video Table Styling */
.videos-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow-x: auto;
  backdrop-filter: blur(12px);
}

.videos-table-container.hidden {
  display: none !important;
}

.videos-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.videos-table th,
.videos-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}

.videos-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.videos-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

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

.col-rank {
  width: 80px;
  text-align: center;
  font-weight: bold;
}

.table-rank-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 800;
}

.table-rank-pill.rank-1 { background-color: #d97706; }
.table-rank-pill.rank-2 { background-color: #64748b; }
.table-rank-pill.rank-3 { background-color: #b45309; }
.table-rank-pill.rank-other { background-color: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-glass); }

.col-thumb {
  width: 140px;
}

.table-thumb {
  width: 100px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  object-fit: cover;
  background-color: #000;
  display: block;
}

.col-title {
  max-width: 350px;
}

.table-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-desc-snippet {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-stat-value {
  font-weight: 600;
  color: var(--text-semi);
}

.table-date-val {
  font-size: 13px;
  color: var(--text-muted);
}

/* Analytics Content */
.analytics-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.chart-card h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-semi);
  margin-bottom: 16px;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-card.large .chart-container {
  height: 380px;
}

.chart-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

/* Modal Details */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  background: #0f1219;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-header {
  padding: 28px 28px 16px 28px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  max-width: 90%;
}

.modal-meta-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-body {
  padding: 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-media img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  background-color: #000;
}

.play-btn {
  font-size: 13px;
  padding: 10px;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.modal-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-stat-box .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-stat-box .value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-description-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.modal-description-box h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-semi);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 6px;
}

.modal-description {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-line;
  padding-right: 6px;
}

/* User Authentication styles */
.auth-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#auth-loading {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.user-role {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.user-role.admin {
  color: var(--accent);
}

.user-role.guest {
  color: var(--text-muted);
}

.auth-logout-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  align-self: flex-end;
  transition: var(--transition);
}

.auth-logout-link:hover {
  color: var(--danger);
  text-decoration: underline;
}

.auth-btn {
  font-size: 13px;
  padding: 10px;
}

/* Disabled Sync Form State */
.sync-section.disabled {
  opacity: 0.55;
  pointer-events: none;
  position: relative;
}

.sync-disabled-msg {
  font-size: 11px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
  line-height: 1.4;
  margin-top: 4px;
}

/* Resync Button Header Control */
.resync-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-semi);
}

.resync-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  transform: translateY(-1px);
}

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

