/* YOUTXO - YouTube-inspired dark theme for Bitcoin inscriptions */

:root {
  /* Core colors - YouTube dark mode inspired */
  --yt-bg-primary: #0f0f0f;
  --yt-bg-secondary: #212121;
  --yt-bg-elevated: #272727;
  --yt-bg-hover: #3f3f3f;
  --yt-bg-active: #3ea6ff20;
  
  /* Text colors */
  --yt-text-primary: #f1f1f1;
  --yt-text-secondary: #aaaaaa;
  --yt-text-disabled: #717171;
  
  /* Brand colors - YOUTXO orange/bitcoin inspired */
  --yt-brand: #f7931a;
  --yt-brand-hover: #ffab40;
  --yt-brand-dark: #c77700;
  
  /* Accent colors */
  --yt-accent-blue: #3ea6ff;
  --yt-accent-green: #2ba640;
  --yt-accent-red: #ff0000;
  
  /* Borders */
  --yt-border: #3f3f3f;
  --yt-border-light: #ffffff1a;
  
  /* Shadows */
  --yt-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --yt-shadow-lg: 0 4px 32px rgba(0, 0, 0, 0.4);
  
  /* Sizing */
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;
  --header-height: 56px;
  
  /* Typography */
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Roboto Mono', 'SF Mono', 'Monaco', monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.4;
  background: var(--yt-bg-primary);
  color: var(--yt-text-primary);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--yt-accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  background: var(--yt-bg-elevated);
  border: 1px solid var(--yt-border);
  color: var(--yt-text-primary);
  border-radius: 8px;
  padding: 8px 12px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--yt-accent-blue);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--yt-bg-secondary);
  border-bottom: 1px solid var(--yt-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
  transition: background 0.2s;
}

.menu-btn:hover {
  background: var(--yt-bg-hover);
}

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--yt-text-primary);
  text-decoration: none;
}

.logo img {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-studio {
  font-size: 10px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  vertical-align: super;
  margin-left: 2px;
}

.header-center {
  flex: 1;
  max-width: 640px;
  margin: 0 40px;
}

.search-box {
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input {
  flex: 1;
  height: 40px;
  padding: 0 16px;
  background: var(--yt-bg-primary);
  border: 1px solid var(--yt-border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  color: var(--yt-text-primary);
  font-size: 16px;
}

.search-input::placeholder {
  color: var(--yt-text-disabled);
}

.search-input:focus {
  outline: none;
  border-color: var(--yt-accent-blue);
}

.search-btn {
  height: 40px;
  width: 64px;
  background: var(--yt-bg-hover);
  border: 1px solid var(--yt-border);
  border-radius: 0 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
}

.search-btn:hover {
  background: var(--yt-bg-elevated);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--yt-bg-hover);
}

.create-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--yt-bg-hover);
  border-radius: 20px;
  color: var(--yt-text-primary);
  font-weight: 500;
  transition: background 0.2s;
}

.create-btn:hover {
  background: var(--yt-bg-elevated);
}

.wallet-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--yt-brand);
  border-radius: 20px;
  color: #000;
  font-weight: 500;
  transition: background 0.2s;
}

.wallet-btn:hover {
  background: var(--yt-brand-hover);
}

.wallet-btn.connected {
  background: var(--yt-bg-hover);
  color: var(--yt-text-primary);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--yt-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #000;
  overflow: hidden;
}

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

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--yt-bg-secondary);
  border-right: 1px solid var(--yt-border);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 12px 0;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--yt-bg-hover);
  border-radius: 4px;
}

.sidebar-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--yt-border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-title {
  padding: 8px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--yt-text-primary);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  color: var(--yt-text-primary);
  transition: background 0.2s;
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--yt-bg-hover);
}

.sidebar-item.active {
  background: var(--yt-bg-active);
  color: var(--yt-accent-blue);
}

.sidebar-item.active .sidebar-icon {
  color: var(--yt-accent-blue);
}

.sidebar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
}

.sidebar-label {
  font-size: 14px;
  white-space: nowrap;
}

/* Channel card in sidebar */
.channel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border-bottom: 1px solid var(--yt-border);
}

.channel-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--yt-bg-hover);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.channel-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-primary);
  text-align: center;
}

.channel-handle {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 400;
  color: var(--yt-text-primary);
  margin-bottom: 16px;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--yt-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--yt-text-primary);
  background: var(--yt-bg-hover);
}

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

/* Chip tabs (like YouTube feed filters) */
.chip-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chip {
  padding: 8px 16px;
  background: var(--yt-bg-elevated);
  border-radius: 8px;
  font-size: 14px;
  color: var(--yt-text-primary);
  white-space: nowrap;
  transition: background 0.2s;
}

.chip:hover {
  background: var(--yt-bg-hover);
}

.chip.active {
  background: var(--yt-text-primary);
  color: var(--yt-bg-primary);
}

/* ============================================
   CONTENT GRID (Feed)
   ============================================ */

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.content-card {
  background: var(--yt-bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--yt-shadow);
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--yt-bg-elevated);
  position: relative;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumbnail iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.card-type {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  background: var(--yt-brand);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #000;
}

.card-body {
  display: flex;
  gap: 12px;
  padding: 12px;
}

.card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yt-bg-hover);
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

.card-creator {
  margin-bottom: 2px;
}

.card-stats {
  display: flex;
  gap: 8px;
}

/* ============================================
   CONTENT TABLE (Studio)
   ============================================ */

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

.content-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  border-bottom: 1px solid var(--yt-border);
}

.content-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--yt-border);
  vertical-align: middle;
}

.content-table tr:hover {
  background: var(--yt-bg-hover);
}

.table-thumbnail {
  width: 120px;
  height: 68px;
  background: var(--yt-bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.table-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.empty-icon {
  width: 200px;
  height: 200px;
  margin-bottom: 24px;
  color: var(--yt-text-disabled);
}

.empty-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.6;
}

.empty-title {
  font-size: 16px;
  color: var(--yt-text-secondary);
  margin-bottom: 24px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--yt-text-primary);
  color: var(--yt-bg-primary);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: var(--yt-text-secondary);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: transparent;
  color: var(--yt-accent-blue);
  border: 1px solid var(--yt-border);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: var(--yt-bg-active);
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  margin-bottom: 16px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--yt-bg-elevated);
  border-radius: 4px;
  color: var(--yt-text-secondary);
  font-size: 14px;
}

.filter-btn:hover {
  background: var(--yt-bg-hover);
  color: var(--yt-text-primary);
}

/* ============================================
   DROPDOWN
   ============================================ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--yt-bg-elevated);
  border-radius: 12px;
  box-shadow: var(--yt-shadow-lg);
  padding: 8px 0;
  z-index: 200;
  display: none;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  color: var(--yt-text-primary);
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--yt-bg-hover);
}

.dropdown-divider {
  height: 1px;
  background: var(--yt-border);
  margin: 8px 0;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--yt-bg-secondary);
  border-radius: 12px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--yt-shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--yt-border);
}

.modal-title {
  font-size: 20px;
  font-weight: 400;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
}

.modal-close:hover {
  background: var(--yt-bg-hover);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 130px);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--yt-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

/* Bitcoin/Ordinals flair */
.sat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--yt-brand);
  color: #000;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.inscription-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yt-text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  
  .sidebar-label,
  .sidebar-title,
  .channel-card {
    display: none;
  }
  
  .sidebar-item {
    justify-content: center;
    padding: 16px;
    gap: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .header-center {
    display: none;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
}

