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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #fafafa;
  color: #222;
  min-height: 100vh;
}

#app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 120px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
}

.sidebar.collapsed {
  width: 40px;
}

.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.sidebar nav a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #666;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar nav a:hover {
  color: #222;
  background: #f5f5f5;
}

.sidebar nav a.active {
  color: #222;
  border-left-color: #222;
}

.sidebar.collapsed nav a {
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.toggle-btn {
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #666;
  font-size: 1rem;
}

.toggle-btn:hover {
  background: #f0f0f0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.address-bar {
  padding: 0;
  padding-bottom: 1rem;
  background: transparent;
}

.address-bar input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
}

.address-bar input:focus {
  outline: none;
  border-color: #999;
}

.content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.content.hidden {
  display: none;
}

.go-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
}

.player-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#video-title {
  max-width: 900px;
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.channel-bar {
  max-width: 900px;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.channel-name {
  flex: 1;
  color: #444;
  font-weight: 500;
}

.video-description {
  max-width: 900px;
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #333;
}

.video-description a {
  color: #0066cc;
  text-decoration: none;
}

.video-description a:hover {
  text-decoration: underline;
}

.video-actions {
  max-width: 900px;
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover {
  background: #f5f5f5;
}

.history-page {
  max-width: 900px;
}

.history-page h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.history-item:hover {
  background: #f5f5f5;
}

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

.history-title {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-channel {
  display: block;
  color: #666;
  font-size: 0.85rem;
}

.history-vid {
  font-family: monospace;
  font-size: 0.75rem;
  color: #999;
  white-space: nowrap;
}

.history-date {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: #666;
}

.placeholder h2 {
  margin-bottom: 0.5rem;
}

.nav-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #666;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  color: #222;
  background: #f5f5f5;
}

.nav-item.active {
  color: #222;
  border-left-color: #222;
}

/* Settings link at bottom of sidebar */
.settings-link {
  margin-top: auto;
  border-top: 1px solid #e0e0e0;
}

/* Settings page */
.settings-page {
  max-width: 600px;
}

.settings-page h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: #222;
}

.settings-section {
  margin-bottom: 2.5rem;
}

.settings-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 0.75rem;
}

.settings-description {
  color: #444;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.settings-stats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.stat-label {
  color: #666;
}

.stat-value {
  font-weight: 500;
  font-family: monospace;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
}

/* Outline button style - blue border, white bg, blue text */
.btn-outline {
  padding: 0.5rem 1.25rem;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  background: #fff;
  color: #3b82f6;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.btn-outline:hover {
  background: #eff6ff;
}

.btn-outline:active {
  background: #dbeafe;
}

/* Feeds page */
.feeds-page {
  max-width: 900px;
}

.feeds-page h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.feeds-page h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 1.5rem 0 0.75rem 0;
  color: #444;
}

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

.feeds-header h2 {
  margin: 0;
}

.feeds-header-actions {
  display: flex;
  gap: 0.5rem;
}

.feeds-breadcrumb {
  font-size: 0.9rem;
  color: #666;
}

.breadcrumb-link {
  color: #3b82f6;
  text-decoration: none;
}

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

/* Feed list */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.feed-list-item:hover {
  background: #f5f5f5;
}

.feed-name {
  font-weight: 500;
}

.feed-count {
  color: #666;
  font-size: 0.85rem;
}

/* Channel list in manage view */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.channel-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 4px;
}

.channel-link {
  color: #222;
  text-decoration: none;
  font-weight: 500;
}

.channel-link:hover {
  color: #3b82f6;
}

.channel-id {
  color: #999;
  font-size: 0.75rem;
}

.btn-remove-channel {
  margin-left: auto;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.btn-remove-channel:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Add channel form */
.add-channel-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.add-channel-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
}

/* Feed settings */
.feed-settings {
  display: flex;
  gap: 0.75rem;
}

.btn-danger {
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-danger:hover {
  background: #fee2e2;
}

.feeds-empty {
  color: #666;
  padding: 2rem 0;
}

.feeds-actions {
  margin-bottom: 1.5rem;
}

.feed-error {
  color: #dc2626;
  margin-bottom: 1rem;
}

/* Video list */
.feed-video-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feed-video-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.feed-video-item:hover {
  background: #f5f5f5;
}

.feed-video-date {
  color: #999;
  font-size: 0.75rem;
  font-family: monospace;
  white-space: nowrap;
}

.feed-video-id {
  color: #999;
  font-size: 0.75rem;
  font-family: monospace;
  white-space: nowrap;
}

.feed-video-channel {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 120px;
}

.feed-video-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
