/**
 * WordPress Comments Styling (YouTube-style)
 *
 * Styles for native WordPress comments using YouTube-style UI that matches
 * the activity feed comment system.
 *
 * @package Videohub360_Theme
 * @since 1.0.0
 */

/* ========================================
   Comments Section Container
   ======================================== */

.vh360-comments-section {
    max-width: 680px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.vh360-comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: var(--text-1);
}

.vh360-comments-empty {
    text-align: center;
    color: var(--text-2);
    font-size: 0.9375rem;
    padding: 2rem 1rem;
    margin: 0 0 2rem;
}

.vh360-no-comments {
    text-align: center;
    color: var(--text-2);
    font-size: 0.9375rem;
    padding: 1rem;
    margin: 1rem 0;
    background: var(--surface-3);
    border-radius: 8px;
}

/* ========================================
   Comment Navigation
   ======================================== */

.vh360-comment-navigation {
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-1);
    border-bottom: 1px solid var(--border-1);
}

.vh360-comment-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.vh360-comment-navigation .nav-previous,
.vh360-comment-navigation .nav-next {
    flex: 1;
}

.vh360-comment-navigation .nav-next {
    text-align: right;
}

.vh360-comment-navigation a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    display: inline-block;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.vh360-comment-navigation a:hover {
    background-color: var(--surface-3);
}

/* ========================================
   YouTube-Style Comment Form
   ======================================== */

.vh360-wp-comment-form {
    margin: 2rem 0 0;
}

.vh360-wp-comment-form .comment-reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vh360-wp-comment-form .comment-reply-title small {
    font-size: 0.875rem;
    font-weight: 600;
}

.vh360-wp-comment-form .comment-reply-title small a {
    color: var(--primary-color);
    text-decoration: none;
}

.vh360-wp-comment-form .comment-reply-title small a:hover {
    text-decoration: underline;
}

/* Form fields for non-logged-in users */
.vh360-wp-comment-form .vh360-comment-form-field {
    margin-bottom: 1rem;
}

.vh360-wp-comment-form .vh360-comment-form-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--text-1);
}

.vh360-wp-comment-form .vh360-comment-form-field label .required {
    color: var(--error-color);
}

.vh360-wp-comment-form .vh360-comment-form-field input[type="text"],
.vh360-wp-comment-form .vh360-comment-form-field input[type="email"],
.vh360-wp-comment-form .vh360-comment-form-field input[type="url"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-1);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--surface-1);
    color: var(--text-1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vh360-wp-comment-form .vh360-comment-form-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Must log in message */
.vh360-wp-comment-form .must-log-in {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-3);
    border-radius: 8px;
    margin: 0;
}

.vh360-wp-comment-form .must-log-in a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.vh360-wp-comment-form .must-log-in a:hover {
    text-decoration: underline;
}

/* Login prompt for logged-out users */
.vh360-comments-login-prompt {
    margin: 10px 0 14px;
    font-size: 14px;
    text-align: center;
}

.vh360-comments-login-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.vh360-comments-login-link:hover {
    text-decoration: underline;
}

/* Hide default submit button (we use custom one in textarea wrapper) */
.vh360-comment-submit-hidden {
    display: none !important;
}

/* ========================================
   Comment Time Link Styling
   ======================================== */

.vh360-comment-time-link {
    color: inherit;
    text-decoration: none;
}

.vh360-comment-time-link:hover {
    text-decoration: underline;
}

/* ========================================
   Comment Awaiting Moderation
   ======================================== */

.comment-awaiting-moderation {
    color: var(--warning-color, #f59e0b);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.vh360-comment-bubble.comment-awaiting-moderation {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ========================================
   WordPress Comment-Specific Classes
   ======================================== */

/* Distinguish WP comment actions from activity feed */
.vh360-wp-comment-like,
.vh360-wp-comment-reply,
.vh360-wp-comment-edit-btn,
.vh360-wp-comment-delete-btn,
.vh360-wp-toggle-replies {
    /* Inherits styles from activity-feed.css */
}

/* Toggle replies icon animation */
.vh360-toggle-replies .vh360-toggle-icon {
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.vh360-toggle-replies[aria-expanded="true"] .vh360-toggle-icon {
    transform: rotate(180deg);
}

/* Replies toggle wrapper */
.vh360-comment-replies-toggle-wrapper {
    margin-top: 8px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media screen and (max-width: 768px) {
    .vh360-comments-section {
        padding: 0 0.75rem;
    }
    
    .vh360-comments-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .vh360-comment-navigation .nav-links {
        flex-direction: column;
    }
    
    .vh360-comment-navigation .nav-next {
        text-align: left;
    }
    
    /* Reduce avatar size on mobile for replies */
    .vh360-comment-reply .vh360-comment-avatar {
        width: 32px;
        height: 32px;
    }
    
    .vh360-comment-reply .vh360-comment-avatar img {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   Dark Mode Support (if theme has dark mode)
   ======================================== */

@media (prefers-color-scheme: dark) {
    body.vh360-auto-dark-mode .vh360-comments-section {
        /* Dark mode adjustments would go here if needed */
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

/* Focus visible for keyboard navigation */
.vh360-action-like:focus-visible,
.vh360-action-reply:focus-visible,
.vh360-kebab-toggle:focus-visible,
.vh360-toggle-replies:focus-visible,
.vh360-actions-menu-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to comments link */
.skip-to-comments {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-comments:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    z-index: 100000;
}

/* ========================================
   Loading States
   ======================================== */

.vh360-comment-send-btn.vh360-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.vh360-comment-send-btn.vh360-btn-loading .vh360-btn-text {
    display: none;
}

.vh360-comment-send-btn.vh360-btn-loading .vh360-btn-spinner {
    display: block !important;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .vh360-comment-actions,
    .vh360-kebab-toggle,
    .vh360-toggle-replies,
    .vh360-wp-comment-form {
        display: none !important;
    }
    
    .vh360-replies-list {
        display: block !important;
    }
}
