:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #7c3aed;
    --bg: #ffffff;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --max-width: 1320px;
    --header-height: 60px;
    --grid-cols: 4;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-surface);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ========== HEADER ========== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header__inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.header__logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.header__logo span { color: var(--primary); }
.header__logo:hover { color: var(--text); }

.header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.header__nav a {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.header__nav a:hover,
.header__nav a.active {
    color: var(--text);
    background: var(--bg-surface);
}

.header__search {
    position: relative;
    margin-left: auto;
}

.header__search input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text);
    transition: all 0.2s;
}

.header__search input:focus {
    outline: none;
    border-color: var(--primary);
    width: 300px;
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header__search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-outline { border-color: var(--border); color: var(--text-muted); background: var(--bg); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-danger { background: var(--danger); color: #fff; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
}

.btn-icon:hover { background: var(--bg-surface); color: var(--text); }
.btn-icon.active { color: var(--primary); border-color: var(--primary); }

/* ========== SORT TABS ========== */
.sort-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.sort-tabs a {
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
}

.sort-tabs a:hover { color: var(--text); background: var(--bg-surface); }
.sort-tabs a.active { color: var(--bg); background: var(--text); }

/* ========== VIDEO GRID ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    gap: 20px;
}

/* Video Card */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-light);
}

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

.video-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #1e293b;
}

.video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-card__thumb img {
    transform: scale(1.05);
}

.video-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.video-card__info {
    padding: 12px;
}

.video-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.video-card__title a { color: var(--text); }
.video-card__title a:hover { color: var(--primary); }

.video-card__meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-card__stats {
    font-size: 12px;
    color: var(--text-light);
}

/* ========== VIDEO PAGE ========== */
.video-page {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    padding: 24px 0;
}

.video-player {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-player video,
.video-player iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.video-info {
    padding: 20px 0;
}

.video-info__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.video-info__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.video-info__stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.video-info__actions {
    display: flex;
    gap: 8px;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    transition: all 0.15s;
}

.vote-btn:hover { border-color: var(--text-muted); }
.vote-btn.active.like { color: var(--success); border-color: var(--success); }
.vote-btn.active.dislike { color: var(--danger); border-color: var(--danger); }

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tag-link {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.tag-link:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.video-performers {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.performer-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 9999px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s;
}

.performer-chip:hover { border-color: var(--primary); color: var(--primary); }

.performer-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.video-description {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

/* Sidebar related */
.video-sidebar h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-card {
    display: flex;
    gap: 10px;
}

.related-card__thumb {
    width: 160px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #1e293b;
    position: relative;
}

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

.related-card__thumb span {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
}

.related-card__info { flex: 1; }

.related-card__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.related-card__title a { color: var(--text); }
.related-card__title a:hover { color: var(--primary); }

.related-card__meta { font-size: 12px; color: var(--text-light); }

/* ========== COMMENTS ========== */
.comments { margin-top: 24px; }

.comments__header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.comment-form {
    margin-bottom: 24px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: var(--bg);
    color: var(--text);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.comment-form .btn { margin-top: 8px; }

.comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.comment__body { flex: 1; }

.comment__author {
    font-weight: 600;
    font-size: 14px;
}

.comment__date {
    font-size: 12px;
    color: var(--text-light);
    margin-left: 8px;
}

.comment__text {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.comment__replies {
    margin-left: 52px;
}

/* ========== CATEGORIES PAGE ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-dark);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: all 0.3s;
}

.category-card:hover img { opacity: 0.5; transform: scale(1.05); }

.category-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 16px;
}

.category-card__name {
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.category-card__count {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}

/* ========== TAGS PAGE ========== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0;
}

.tag-cloud .tag-link {
    font-size: 14px;
    padding: 6px 16px;
}

.tag-cloud .tag-link.tag-lg { font-size: 18px; font-weight: 600; }
.tag-cloud .tag-link.tag-md { font-size: 16px; }

/* ========== PERFORMERS PAGE ========== */
.performer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.performer-card {
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.performer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.performer-card__photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    background: var(--bg-surface);
}

.performer-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.performer-card__count {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== PERFORMER PROFILE ========== */
.performer-profile {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.performer-profile__photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.performer-profile__info { flex: 1; }

.performer-profile__name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.performer-profile__bio {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.performer-profile__meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.performer-profile__social {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.performer-profile__social a {
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 13px;
    border: 1px solid var(--border);
}

.performer-profile__social a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ========== SEARCH ========== */
.search-page__form {
    max-width: 600px;
    margin: 24px auto;
    position: relative;
}

.search-page__input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
}

.search-page__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-page__form svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-results__count {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ========== AUTH PAGES ========== */
.auth-page {
    max-width: 440px;
    margin: 48px auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.auth-card__title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-error {
    padding: 10px 14px;
    background: #fee2e2;
    color: var(--danger);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.form-success {
    padding: 10px 14px;
    background: #d1fae5;
    color: var(--success);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a { font-weight: 500; }

/* ========== USER PAGES ========== */
.user-page__header {
    margin-bottom: 24px;
}

.user-page__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-page__subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== STATIC PAGE ========== */
.static-page {
    max-width: 800px;
    margin: 32px auto;
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.static-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.static-page p { margin-bottom: 16px; }
.static-page h2 { margin: 24px 0 12px; font-size: 20px; }
.static-page h3 { margin: 20px 0 10px; font-size: 17px; }
.static-page ul, .static-page ol { margin: 12px 0; padding-left: 24px; }
.static-page li { margin-bottom: 6px; }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 32px 0;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.pagination__link:hover { color: var(--primary); border-color: var(--primary); }

.pagination__link--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination__dots {
    padding: 0 8px;
    color: var(--text-light);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 40px 0 20px;
    margin-top: 48px;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}

.footer__brand { max-width: 300px; }

.footer__logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.footer__logo span { color: var(--primary); }

.footer__desc {
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.7;
}

.footer__links h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
}

.footer__links a {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    padding: 3px 0;
    transition: color 0.15s;
}

.footer__links a:hover { color: #fff; }

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 32px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: 0.6;
}

.footer__disclaimer {
    max-width: 600px;
    font-size: 11px;
    line-height: 1.5;
}

/* ========== SECTION TITLES ========== */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state__icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state__text { font-size: 16px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    :root { --grid-cols: 3; }
    .video-page { grid-template-columns: 1fr; }
    .video-sidebar { order: 2; }
}

@media (max-width: 768px) {
    :root { --grid-cols: 2; }
    .header__nav { display: none; }
    .header__search input { width: 160px; }
    .header__search input:focus { width: 200px; }
    .performer-profile { flex-direction: column; align-items: center; text-align: center; }
    .performer-profile__meta { justify-content: center; }
    .footer__inner { flex-direction: column; }
}

@media (max-width: 480px) {
    :root { --grid-cols: 1; }
    .sort-tabs { overflow-x: auto; }
    .sort-tabs a { white-space: nowrap; }
}
