/**
 * The Video Museum - Main Stylesheet
 * Version: 1.0.0
 */

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: #333;
  background: #fff;
  min-width: 320px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #3498db; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #2980b9; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.content-area { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 32px 0; }
.content-area__main { min-width: 0; }

/* Header */
.site-header { background: #fff; border-bottom: 2px solid #c0c0c0; position: sticky; top: 0; z-index: 100; }
.header-top { padding: 16px 0; border-bottom: 1px solid #e0e0e0; background: #fff; }
.header-top__inner { display: flex; align-items: center; gap: 24px; }
.header-top__logo { flex-shrink: 0; }
.site-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: #333; }
.site-logo:hover { color: #333; }
.header-top__search { flex: 1; max-width: 600px; position: relative; }
.search-form { position: relative; }
.search-form__field { width: 100%; padding: 12px 48px 12px 16px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 15px; }
.search-form__field:focus { outline: none; border-color: #3498db; }
.search-form__submit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 8px; color: #666; }
.btn--submit { background: #e17055; color: #fff; padding: 12px 24px; border-radius: 8px; font-weight: 600; transition: background 0.3s; display: inline-block; }
.btn--submit:hover { background: #d35400; color: #fff; }

/* Navigation */
.header-nav { background: #f5f5f5; padding: 0; }
.header-nav__menu { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; }
.header-nav__menu li { margin: 0; }
.header-nav__menu li a { display: block; padding: 16px 24px; color: #333; font-weight: 600; transition: background 0.3s; }
.header-nav__menu li a:hover { background: #e0e0e0; color: #333; }
.header-subnav { background: #fff; border-top: 1px solid #e0e0e0; padding: 12px 0; }
.header-subnav__scroll { overflow-x: auto; }
.header-subnav__menu { display: flex; gap: 8px; list-style: none; white-space: nowrap; margin: 0; padding: 0; }
.header-subnav__menu li a { display: block; padding: 8px 16px; background: #f5f5f5; border-radius: 4px; color: #666; font-size: 14px; }
.header-subnav__menu li a:hover { background: #e0e0e0; color: #333; }

/* Video Cards */
.video-grid { display: flex; flex-direction: column; gap: 16px; }
.video-card { display: flex; gap: 16px; background: #fff; border-radius: 12px; padding: 16px; transition: box-shadow 0.3s; border: 1px solid #e0e0e0; }
.video-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.video-card__link { display: flex; gap: 16px; width: 100%; color: inherit; text-decoration: none; }
.video-card__image { flex-shrink: 0; width: 280px; height: 175px; position: relative; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.video-card__image img { width: 100%; height: 100%; object-fit: cover; }
.video-card__duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; padding: 4px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; }
.video-card__content { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.video-card__title { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #333; }
.video-card__description { color: #666; font-style: italic; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.video-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; background: #e0e0e0; color: #333; }
.tag--blue { background: #e3f2fd; color: #1976d2; }
.tag--green { background: #e8f5e9; color: #388e3c; }
.tag--orange { background: #fff3e0; color: #f57c00; }
.tag--purple { background: #f3e5f5; color: #7b1fa2; }
.tag--yellow { background: #fffde7; color: #f57f17; }
.tag--pink { background: #fce4ec; color: #c2185b; }
.tag--red { background: #ffebee; color: #c62828; }
.tag--cyan { background: #e0f7fa; color: #0097a7; }
.video-card__meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: #666; }
.meta-item { display: flex; align-items: center; gap: 4px; }

/* Single Video */
.video-player__wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; background: #000; margin-bottom: 24px; }
.video-player__wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-header { margin-bottom: 24px; }
.video-header__title { font-size: 28px; margin-bottom: 16px; }
.video-header__actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.btn-clap { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: #f5f5f5; border-radius: 8px; cursor: pointer; transition: all 0.3s; border: 2px solid #e0e0e0; }
.btn-clap:hover { background: #e0e0e0; }
.btn-clap__icon { font-size: 20px; }
.btn-clap__count { font-weight: 700; }
.vote-buttons { display: flex; align-items: center; gap: 8px; }
.vote-button { padding: 8px; background: #f5f5f5; border-radius: 4px; cursor: pointer; transition: all 0.3s; }
.vote-score { font-weight: 700; min-width: 40px; text-align: center; }

/* AI Curator */
.ai-curator { background: #f0f4ff; border-left: 4px solid #667eea; padding: 20px; margin: 24px 0; border-radius: 8px; }
.ai-curator__header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-curator__title { margin: 0; font-size: 18px; }
.ai-curator__content { line-height: 1.8; }

/* Video Meta */
.video-meta { background: #f5f5f5; padding: 20px; border-radius: 8px; margin: 24px 0; }
.video-meta__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.video-meta__item { display: flex; flex-direction: column; gap: 4px; }
.video-meta__label { font-size: 12px; font-weight: 600; color: #666; text-transform: uppercase; }
.video-meta__value { font-size: 14px; }
.video-meta__tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Comments */
.comments-area { margin-top: 48px; }
.comments-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #e0e0e0; }
.comments-title { font-size: 24px; margin: 0; }
.best-comment { background: #fff9e6; border: 2px solid #ffd700; border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.best-comment__badge { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; color: #f57c00; }
.comment { background: #f8f9fa; border-radius: 12px; padding: 16px; margin-bottom: 12px; transition: box-shadow 0.3s; }
.comment:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.comment .comment { margin-left: 32px; margin-top: 12px; border-left: 2px solid #e0e0e0; padding-left: 16px; }
.comment-meta { display: flex; justify-content: space-between; margin-bottom: 12px; }
.comment-author { display: flex; align-items: center; gap: 12px; }
.comment-author__name { font-weight: 600; }
.user-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; background: #e0e0e0; }
.user-badge--hot { background: #ff5722; color: #fff; }
.user-badge--director { background: #ffd700; color: #333; }
.user-badge--archivist { background: #9c27b0; color: #fff; }
.user-badge--regular { background: #2196f3; color: #fff; }
.comment-content { line-height: 1.6; margin-bottom: 12px; }
.comment-actions { display: flex; gap: 16px; align-items: center; }
.comment-vote { display: flex; align-items: center; gap: 8px; }
.vote-btn { padding: 4px; color: #666; transition: color 0.3s; }
.vote-btn:hover { color: #333; }
.vote-score { font-weight: 700; min-width: 30px; text-align: center; }
.comment-reply-link { color: #3498db; font-size: 14px; }
.tvm-comment-form { background: #f5f5f5; padding: 20px; border-radius: 8px; margin-bottom: 24px; }
.comment-form-comment textarea { width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; min-height: 120px; }
.comment-form-author input, .comment-form-email input { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 12px; }

/* Sidebar */
.sidebar { background: #f5f5f5; padding: 20px; border-radius: 8px; }
.widget { margin-bottom: 32px; }
.widget__title { font-size: 18px; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #e0e0e0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.top-list { list-style: none; padding: 0; }
.top-list__item { display: flex; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #e0e0e0; }
.top-list__item:last-child { border-bottom: none; }
.top-list__number { width: 24px; height: 24px; background: #3498db; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.top-list__link { flex: 1; display: flex; justify-content: space-between; gap: 8px; color: #333; }
.top-list__title { flex: 1; font-size: 14px; }
.top-list__claps, .top-list__views { font-size: 12px; color: #999; }

/* Footer */
.site-footer { background: #f5f5f5; border-top: 2px solid #c0c0c0; margin-top: 64px; }
.footer-widgets { padding: 48px 0; }
.footer-widgets__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-bottom { background: #e0e0e0; padding: 24px 0; }
.footer-bottom__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-bottom__nav { display: flex; gap: 16px; font-size: 14px; }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none; }
.btn--primary { background: #3498db; color: #fff; }
.btn--primary:hover { background: #2980b9; color: #fff; }
.btn--secondary { background: #e0e0e0; color: #333; }

/* Archive Header */
.archive-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid #e0e0e0; }
.archive-header__title { font-size: 32px; margin-bottom: 8px; }

/* Pagination */
.pagination { margin-top: 48px; display: flex; justify-content: center; gap: 8px; }
.page-numbers { padding: 10px 16px; border: 1px solid #e0e0e0; border-radius: 4px; color: #333; }
.page-numbers:hover, .page-numbers.current { background: #3498db; color: #fff; border-color: #3498db; }

/* No Results */
.no-results { text-align: center; padding: 64px 32px; }
.no-results h2 { font-size: 24px; margin-bottom: 16px; }
.no-results p { color: #666; }

/* Responsive */
@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header-top__inner { flex-wrap: wrap; }
  .header-top__search { order: 3; flex-basis: 100%; max-width: 100%; }
  .video-card { flex-direction: column; }
  .video-card__image { width: 100%; height: auto; aspect-ratio: 16/9; }
  .footer-widgets__grid { grid-template-columns: 1fr; }
}
