/* ============================================================
   Pineapl — early YouTube nostalgic stylesheet
   Aesthetic: ~2006-2008 web. Beveled boxes, chunky borders,
   Arial/Verdana stack, muted blues, that specific gray.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tahoma:wght@400;700&display=swap');

:root {
  --bg:          #f7f7f4;
  --page-bg:     #f7f7f4;
  --white:       #ffffff;
  --border:      #cccccc;
  --border-dark: #aaaaaa;
  --blue:        #2e6b3e;
  --blue-light:  #3a8a50;
  --blue-hover:  #1f4f2c;
  --blue-bg:     #eaf3ec;
  --red:         #cc0000;
  --text:        #1a1a1a;
  --text-mid:    #3d3d3d;
  --text-muted:  #717171;
  --link:        #2e6b3e;
  --link-hover:  #1f4f2c;
  --tag-bg:      #eaf3ec;
  --tag-border:  #8ab878;
  --tag-text:    #1f4f2c;
  --header-top:  #1e4d2b;
  --header-bot:  #2a6b3c;
  --font:        Tahoma, Verdana, Arial, sans-serif;
  --radius:      3px;
  --shadow:      inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.2);
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 13px; height: 100%; }

body {
  font-family:    var(--font);
  background:     var(--page-bg);
  color:          var(--text);
  min-height:     100vh;
  display:        flex;
  flex-direction: column;
}

#page-wrap {
  flex: 1;
  max-width: 980px;
  margin:    0 auto;
  padding:   10px;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ── Header ───────────────────────────────────────────────── */
#site-header {
  background: linear-gradient(to bottom, var(--header-top), var(--header-bot));
  border-bottom: 2px solid #1a4a10;
  padding: 0;
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
}

#site-logo {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
#site-logo span { color: #ffcc00; }
#site-logo:hover { text-decoration: none; color: #fff; }

#search-bar {
  flex: 1;
  display: flex;
  gap: 0;
  max-width: 420px;
}

#search-bar input[type="text"] {
  flex: 1;
  padding: 4px 7px;
  border: 1px solid #7aaad8;
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: var(--font);
  font-size: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}
#search-bar input[type="text"]:focus { border-color: #ffcc00; }

#search-bar button {
  padding: 4px 10px;
  background: linear-gradient(to bottom, #e8e8e8, #c8c8c8);
  border: 1px solid #7aaad8;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
#search-bar button:hover { background: linear-gradient(to bottom, #f0f0f0, #d8d8d8); }

.header-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
  flex-shrink: 0;
}

.header-nav a, .header-nav button {
  color: #ddeeff;
  font-size: 12px;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  font-family: var(--font);
  cursor: pointer;
}
.header-nav a:hover, .header-nav button:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  text-decoration: none;
  color: #fff;
}
.header-nav .btn-upload {
  background: linear-gradient(to bottom, var(--upload-top, #f5a623), var(--upload-bot, #e08c00));
  border-color: var(--upload-border, #b86c00);
  color: var(--upload-text, #fff);
  font-weight: 700;
}
.header-nav .btn-upload:hover {
  background: linear-gradient(to bottom, var(--upload-hover-top, #ffb733), var(--upload-hover-bot, #e89800));
}

/* ── Layout ────────────────────────────────────────────────── */


.two-col {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.two-col .main  { flex: 1; min-width: 0; }
.two-col .aside { width: 220px; flex-shrink: 0; }

/* ── Module boxes ─────────────────────────────────────────── */
.module {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.module-head {
  background: linear-gradient(to bottom, var(--header-top), var(--header-bot));
  border-bottom: 1px solid var(--border-dark);
  padding: 5px 10px;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-body { padding: 10px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--font);
  font-size: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid;
  text-decoration: none;
  line-height: 1.5;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(to bottom, #4a9e32, #2d7a1e);
  border-color: #1e5c12;
  color: #fff;
}
.btn-primary:hover { background: linear-gradient(to bottom, #5ab040, #3a8a28); color: #fff; }

.btn-secondary {
  background: linear-gradient(to bottom, #f5f5f5, #dcdcdc);
  border-color: var(--border-dark);
  color: var(--text);
}
.btn-secondary:hover { background: linear-gradient(to bottom, #fff, #ebebeb); color: var(--text); }

.btn-danger {
  background: linear-gradient(to bottom, #e86060, #c03030);
  border-color: #8a1a1a;
  color: #fff;
}

/* ── Video grid ────────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.video-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.1s;
}
.video-card:hover { border-color: var(--blue-light); }

.video-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
  position: relative;
}
.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2a3a 0%, #2a3a4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667;
  font-size: 10px;
}

.video-card-info { padding: 6px 8px 8px; }

.video-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-title a { color: inherit; }
.video-card-title a:hover { color: var(--link-hover); text-decoration: none; }

.video-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.video-card-meta a { color: var(--text-muted); }
.video-card-meta a:hover { color: var(--link-hover); }

.status-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-processing { background: #fff3cd; border: 1px solid #e6c84e; color: #856404; }
.status-failed     { background: #fce8e8; border: 1px solid #e09090; color: #8a1a1a; }

/* ── Watch page ─────────────────────────────────────────────── */
#video-player-wrap {
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 360px;
  border: 1px solid #222;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

#video-player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.processing-notice {
  width: 100%;
  height: 100%;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #aaa;
  font-size: 13px;
}
.processing-spinner {
  width: 28px; height: 28px;
  border: 3px solid #333;
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.video-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.video-title-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.video-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.video-description {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.6;
  padding: 8px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  white-space: pre-wrap;
}

.uploader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
  margin-top: 8px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 2px;
  background: var(--blue-bg);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}
.uploader-name { font-weight: 700; font-size: 12px; }
.uploader-name a { color: var(--text); }
.uploader-name a:hover { color: var(--link-hover); }

/* ── Tags ────────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.tag-pill {
  display: inline-block;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
}
.tag-pill:hover {
  background: var(--blue-bg);
  border-color: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

/* ── Comments ────────────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.comment {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.comment:last-child { border-bottom: none; }

.comment-body-wrap { flex: 1; min-width: 0; }
.comment-author { font-weight: 700; font-size: 12px; }
.comment-author a { color: var(--text); }
.comment-date { font-size: 10px; color: var(--text-muted); margin-left: 6px; }
.comment-text { font-size: 12px; color: var(--text-mid); line-height: 1.5; margin-top: 2px; }

.comment-form textarea {
  width: 100%;
  height: 64px;
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
}
.comment-form textarea:focus { border-color: var(--blue-light); }
.comment-form-row { display: flex; justify-content: flex-end; margin-top: 5px; }

/* ── Related videos (sidebar) ────────────────────────────────── */
.related-list { display: flex; flex-direction: column; gap: 8px; }

.related-item {
  display: flex;
  gap: 7px;
  align-items: flex-start;
}
.related-thumb {
  width: 80px;
  aspect-ratio: 16/9;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-info { flex: 1; min-width: 0; }
.related-title { font-size: 11px; font-weight: 700; line-height: 1.3; color: var(--text); }
.related-title a { color: inherit; }
.related-title a:hover { color: var(--link-hover); text-decoration: none; }
.related-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Tag directory ────────────────────────────────────────────── */
.tag-category-section { margin-bottom: 14px; }
.tag-category-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid #ddd;
}
.tag-directory-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 2px;
  text-decoration: none;
}
.tag-dir-pill:hover { background: var(--blue-bg); border-color: var(--blue-light); text-decoration: none; color: var(--blue); }
.tag-dir-count { font-size: 10px; color: var(--text-muted); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  max-width: 420px;
  margin: 20px auto;
}
.form-box h2 { font-size: 15px; margin-bottom: 14px; color: var(--blue); }

.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 3px; color: var(--text-mid); }

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 5px 8px;
  font-family: var(--font);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  outline: none;
  color: var(--text);
}
.form-row input:focus,
.form-row textarea:focus { border-color: var(--blue-light); }
.form-row textarea { resize: vertical; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.form-error {
  background: #fce8e8;
  border: 1px solid #e09090;
  color: #8a1a1a;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

/* ── Upload page ──────────────────────────────────────────────── */
.upload-drop-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: #fafafa;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.upload-drop-area.drag-over {
  border-color: var(--blue-light);
  background: var(--blue-bg);
  color: var(--blue);
}
.upload-drop-area input[type="file"] {
  display: none;
}
.upload-drop-label {
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.upload-progress {
  margin-top: 8px;
  display: none;
}
.upload-progress progress {
  width: 100%;
  height: 10px;
}

/* ── Profile page ──────────────────────────────────────────────── */
.profile-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--blue-bg);
  flex-shrink: 0;
}
.profile-info h2 { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.profile-bio { font-size: 12px; color: var(--text-mid); line-height: 1.5; }
.profile-joined { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Pagination ────────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; padding: 10px 0; align-items: center; }
.pagination a, .pagination span {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--white);
}
.pagination a { color: var(--link); }
.pagination a:hover { background: var(--blue-bg); text-decoration: none; }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Footer ─────────────────────────────────────────────────────── */
#site-footer {
  background: linear-gradient(to bottom, #d0d0d0, #b8b8b8);
  border-top: 1px solid #999;
  margin-top: 20px;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}
#site-footer a { color: var(--text-muted); }
#site-footer a:hover { color: var(--link); }

/* ── Utility ─────────────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.text-muted  { color: var(--text-muted); font-size: 11px; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid #ddd; margin: 8px 0; }
