/* Card stats — likes & views, left of 3-dot menu */
.video-info-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-btn,
.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    background: none;
    border: none;
    padding: 6px 4px;
    cursor: default;
    white-space: nowrap;
}

.stat-btn {
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.stat-btn:hover {
    color: #eee;
    background: rgba(255, 255, 255, 0.05);
}

.stat-btn.liked {
    color: var(--accent);
}

.stat-btn svg,
.stat-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.stat-btn.liked svg {
    fill: var(--accent);
    stroke: none;
}

.video-card.has-open-menu {
    z-index: 100 !important;
    overflow: visible;
}

.options-container .dropdown-menu {
    z-index: 1100;
}

/* Comments modal */
#commentsModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#commentsModal.open {
    display: flex;
}

.comments-panel {
    width: 100%;
    max-width: 520px;
    max-height: min(85vh, 720px);
    background: #16161a;
    border: 1px solid #333;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.comments-header {
    padding: 20px 22px 16px;
    border-bottom: 1px solid #2a2a2f;
    position: relative;
}

.comments-header h2 {
    margin: 0 0 4px;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #eee;
    font-weight: 600;
    padding-right: 36px;
}

.comments-header .comment-count {
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.comments-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.comments-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.comments-auth-bar {
    padding: 12px 22px;
    border-bottom: 1px solid #2a2a2f;
    background: #121216;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.comments-auth-bar.visible {
    display: flex;
}

.comments-auth-bar .auth-user {
    font-size: 0.72rem;
    color: #aaa;
}

.comments-auth-bar .auth-user strong {
    color: var(--accent);
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 120px;
}

.comment {
    padding: 14px 22px;
    border-bottom: 1px solid #222;
}

.comment:last-child {
    border-bottom: none;
}

.comment-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-author {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.comment-time {
    font-size: 0.62rem;
    color: #666;
}

.comment-body {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #ccc;
}

.comment-actions {
    margin-top: 8px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #777;
    cursor: pointer;
    transition: color 0.2s;
}

.comment-action-btn:hover {
    color: var(--accent);
}

.comment-action-btn.delete-btn:hover {
    color: #ff6b6b;
}

.replies {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid #2a2a2f;
}

.reply {
    padding: 10px 0;
}

.reply + .reply {
    border-top: 1px solid #1e1e22;
}

.reply-form,
.comment-form {
    padding: 16px 22px;
    border-top: 1px solid #2a2a2f;
    background: #121216;
    flex-shrink: 0;
}

.auth-form {
    padding: 0;
    border: none;
    background: transparent;
}

.comment-form label {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
}

.comment-form input,
.comment-form textarea,
.auth-inline-row input {
    background: #0d0d10;
    border: 1px solid #333;
    border-radius: 8px;
    color: #eee;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 10px 12px;
    resize: vertical;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    margin-bottom: 10px;
}

.auth-inline-row input {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.comment-form input:focus,
.comment-form textarea:focus,
.auth-inline-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form textarea {
    min-height: 72px;
}

.comment-form-actions,
.auth-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary,
.btn-primary {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.btn-secondary {
    background: transparent;
    color: #888;
}

.btn-secondary:hover {
    color: #ccc;
}

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

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reply-form {
    display: none;
    padding-top: 12px;
    padding-bottom: 0;
    border-top: none;
    background: transparent;
}

.reply-form.open {
    display: block;
}

.empty-comments,
.comments-loading {
    padding: 40px 22px;
    text-align: center;
    color: #555;
    font-size: 0.82rem;
    line-height: 1.6;
}

.auth-prompt {
    padding: 16px 22px;
    border-bottom: 1px solid #2a2a2f;
    background: #121216;
    flex-shrink: 0;
}

.auth-inline-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-inline-row .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

.auth-message {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 12px;
    text-align: left;
}

.auth-status {
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: 10px;
    min-height: 1.2em;
}

@media (max-width: 600px) {
    .card-stats {
        gap: 6px;
    }

    .stat-btn,
    .stat-item {
        font-size: 0.62rem;
    }

    .video-info h3 {
        max-width: 55%;
    }

    .auth-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-inline-row .btn-primary {
        width: 100%;
    }
}
