:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --border: #333333;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.user-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.2s;
}

.user-btn:hover {
  background: var(--bg-tertiary);
}

/* Main */
.main {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 200px);
}

.content-wrapper {
  display: flex;
  gap: 2rem;
  width: 100%;
  max-width: 1400px;
}

.player-wrapper {
  flex: 1;
  max-width: 640px;
}

/* Video */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
}

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

/* Controls */
.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.control-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.control-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.primary-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
}

.primary-btn:hover {
  background: var(--accent-hover);
}

.admin-btn {
  width: auto;
  padding: 0 0.9rem;
  font-size: 0.85rem;
  color: #ff6b6b;
  border-color: #ff6b6b44;
}

.admin-btn:hover {
  background: #ff6b6b22;
}

/* Voting */
.vote-section {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.vote-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s;
}

.vote-btn:hover {
  background: var(--bg-tertiary);
}

.vote-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.vote-btn.voted {
  background: var(--bg-tertiary);
  border-width: 2px;
}

.vote-up.voted {
  color: var(--success);
  border-color: var(--success);
}

.vote-down.voted {
  color: var(--danger);
  border-color: var(--danger);
}

.vote-up:hover {
  color: var(--success);
  border-color: var(--success);
}

.vote-down:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  padding: 1rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-list {
  max-height: 600px;
  overflow-y: auto;
}

.video-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--border);
}

.video-item:hover {
  background: var(--bg-tertiary);
}

.video-item:last-child {
  border-bottom: none;
}

.video-thumbnail {
  width: 120px;
  height: 68px;
  background: #000;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.video-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.video-list-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.auth-form h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.auth-form input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auth-btn:hover {
  background: var(--accent-hover);
}

.auth-switch {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.9rem;
}

.account-field {
  margin-bottom: 1.5rem;
}

.account-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-value {
  font-size: 1rem;
  color: var(--text-primary);
}

.logout-btn {
  background: var(--danger);
  margin-top: 1rem;
}

.logout-btn:hover {
  background: #dc2626;
}

/* Responsive */
@media (max-width: 1200px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 300px;
  }
  
  .sidebar-left {
    order: 1;
  }
  
  .player-wrapper {
    order: 2;
  }
  
  .sidebar-right {
    order: 3;
  }
}

  .header {
    padding: 1rem 0;
  }

  .logo {
    font-size: 1.5rem;
  }

  .controls {
    gap: 0.5rem;
  }

  .primary-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}
