:root {
  --bg: #ffffff;
  --bg-card: #f7f7f7;
  --text: #111111;
  --text-muted: #666666;
  --accent: #ff0000;
  --radius: 8px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --bg-card: #1c1c1c;
    --text: #f1f1f1;
    --text-muted: #bbbbbb;
    --accent: #ff4d4d;
  }
}

body.dark {
  --bg: #0f0f0f;
  --bg-card: #1c1c1c;
  --text: #f1f1f1;
  --text-muted: #bbbbbb;
  --accent: #ff4d4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #ddd;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-center input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
}

/* Button Styles */
.btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.15s background, 0.15s color;
}

.btn-upload,
.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary {
  width: 100%;
  margin-top: 1rem;
  font-size: 1rem;
  padding: 0.7rem;
}

.btn-theme {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid #ccc;
}

.btn-like {
  background: var(--bg-card);
  border: 1px solid #ccc;
  color: white;
}

.btn-like:hover {
  background-color: white;
  color: black;
}

.btn-like.liked {
  background-color: white;
  color: red;
  font-weight: bold;
}

.btn-danger {
  background: #c00;
  color: #fff;
}

/* Layout */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

.empty-msg {
  text-align: center;
  margin-top: 3rem;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-thumb-wrap {
  display: block;
  position: relative;
  padding-top: 56%;
  overflow: hidden;
  background: #000;
}

.video-thumb-wrap img,
.video-thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
}

.video-card-body {
  padding: 0.5rem 1rem;
}

.video-title {
  margin: 0.2rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.video-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Upload Form */
.upload-form {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.upload-form input[type="text"],
.upload-form textarea,
.upload-form input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: #ffe0e0;
  color: #900;
}

.alert-success {
  background: #e0ffe0;
  color: #090;
}

/* Watch Page */
.watch-wrapper {
  max-width: 900px;
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56%;
  background: #000;
  margin-bottom: 1rem;
}

.player-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.watch-title {
  margin: 0.5rem 0;
  font-size: 1.4rem;
}

.watch-meta {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.watch-desc {
  white-space: pre-line;
  font-size: 1rem;
}

.watch-actions {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

/* Action Button */
.btn-action {
  display: flex;
  align-items: center;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 15px;
}

.btn-action .icon {
  margin-right: 6px;
}

.btn-action:hover {
  background-color: #0056b3;
}

.btn-action.liked {
  background-color: #28a745;
}

/* Comments & Share Section */
.comment-section,
.share-section {
  margin-top: 2rem;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment-list li {
  border-bottom: 1px solid #ccc;
  padding: 0.5rem 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-form textarea {
  resize: vertical;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}

.comment-form button {
  align-self: flex-end;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.comment-form button:hover {
  background: #e00;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Progress Bar */
progress {
  height: 20px;
  border-radius: 5px;
}
