/**
 * Enhanced Comments Section Styles
 * Modern UX/UI for WordPress Comments
 */

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

.comments-section.enhanced {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-card, #FEFDFB);
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 15px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

/* Comments Header */
.comments-section h3#comments {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color, #D0CCC6);
    position: relative;
}

.comments-section h3#comments::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
}

/* ==========================================================================
   Comment List Styling
   ========================================================================== */

.commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 40px;
}

.commentlist li.comment {
    margin-bottom: 25px;
    animation: fadeInUp 0.5s ease;
}

/* Comment Body */
.comment-body {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 12px;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.comment-body:hover {
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.08));
    transform: translateY(-2px);
}

/* Child Comments */
.commentlist .children {
    list-style: none;
    padding-left: 40px;
    margin-top: 20px;
}

.commentlist .children .comment-body {
    background: var(--bg-tertiary, #EBE8E4);
    border-left: 3px solid linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
}

/* Comment Meta */
.comment-meta {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.comment-author.vcard {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.comment-author .avatar {
    border-radius: 50%;
    border: 2px solid var(--border-color, #D0CCC6);
    transition: transform 0.3s ease;
}

.comment-author:hover .avatar {
    transform: scale(1.1);
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text-primary, #212529);
    font-size: 1.05rem;
}

.comment-author .fn a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    transition: all 0.3s ease;
}

.comment-author .fn a:hover {
    -webkit-text-fill-color: transparent;
}

.comment-author .says {
    color: var(--text-secondary, #6c757d);
    font-size: 0.9rem;
    font-style: italic;
}

/* Comment Metadata */
.comment-metadata {
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-metadata a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-metadata a:hover {
    color: var(--primary, #00D9FF);
}

.comment-metadata time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.comment-metadata time::before {
    content: '🕒';
    font-size: 0.9em;
}

.edit-link a {
    padding: 2px 8px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.edit-link a:hover {
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    color: #0A0F1C;
}

/* Comment Content */
.comment-content {
    color: var(--text-primary, #212529);
    line-height: 1.7;
    margin-bottom: 15px;
}

.comment-content p {
    margin-bottom: 12px;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content a {
    color: var(--primary, #00D9FF);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary, #00D9FF);
    transition: all 0.3s ease;
}

.comment-content a:hover {
    border-bottom-style: solid;
}

/* Reply Link */
.comment .reply {
    text-align: right;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
    text-decoration: none;
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.comment-reply-link::before {
    content: '↩';
    font-size: 1.1em;
}

.comment-reply-link:hover {
    background: var(--primary, #00D9FF);
    color: #ffffff;
    border-color: var(--primary, #00D9FF);
    transform: translateY(-2px);
}

/* ==========================================================================
   Comment Form
   ========================================================================== */

#respond {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    border: 2px dashed var(--border-color, #D0CCC6);
}

#reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#cancel-comment-reply-link {
    font-size: 0.9rem;
    color: #dc3545;
    text-decoration: none;
    padding: 5px 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

#cancel-comment-reply-link:hover {
    background: #dc3545;
    color: #fff;
}

/* Comment Form */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logged-in-as {
    padding: 15px;
    background: var(--bg-card, #FEFDFB);
    border-radius: 8px;
    border: 1px solid var(--border-color, #D0CCC6);
    font-size: 0.95rem;
    color: var(--text-secondary, #6c757d);
}

.logged-in-as a {
    color: var(--primary, #00D9FF);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logged-in-as a:hover {
    text-decoration: underline;
}

/* Comment Textarea */
.comment-form-comment {
    position: relative;
}

.comment-form-comment label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.comment-form-comment textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    background: var(--bg-card, #FEFDFB);
    border: 2px solid var(--border-color, #D0CCC6);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary, #212529);
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--primary, #00D9FF);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.comment-form-comment textarea::placeholder {
    color: var(--text-muted, #adb5bd);
    font-style: italic;
}

/* Character Counter */
.character-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    background: var(--bg-card, #FEFDFB);
    padding: 2px 8px;
    border-radius: 12px;
    pointer-events: none;
}

.character-counter .current {
    font-weight: 600;
    color: var(--primary, #00D9FF);
}

/* Submit Button */
.form-submit {
    display: flex;
    gap: 15px;
    align-items: center;
}

.form-submit .submit {
    padding: 12px 30px;
    background: var(--primary, #00D9FF);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-submit .submit:hover {
    background: var(--primary-dark, #00B8E6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

.form-submit .submit:active {
    transform: translateY(0);
}

/* Required Fields */
.required {
    color: #dc3545;
    font-weight: 700;
}

.required-field-message {
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    margin-left: 10px;
}

/* ==========================================================================
   Navigation (Pagination)
   ========================================================================== */

.comments-section .navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color, #D0CCC6);
    border-bottom: 1px solid var(--border-color, #D0CCC6);
}

.comments-section .navigation a {
    padding: 8px 16px;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.comments-section .navigation a:hover {
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    color: #0A0F1C;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.no-comments {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #6c757d);
}

.no-comments::before {
    content: '💬';
    display: block;
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-comments h3 {
    color: var(--text-primary, #212529);
    margin-bottom: 10px;
}

.no-comments p {
    font-size: 1.1rem;
}

/* ==========================================================================
   Dark Mode Styles
   ========================================================================== */

body.dark-mode .comments-section.enhanced {
    background: var(--bg-card, #151B2C);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .comments-section h3#comments {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .comment-body {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .comment-body:hover {
    background: #2A3344;
}

body.dark-mode .commentlist .children .comment-body {
    background: #0f172a;
}

body.dark-mode .comment-author .fn {
    color: #ffffff;
}

body.dark-mode .comment-author .says {
    color: #94a3b8;
}

body.dark-mode .comment-metadata {
    color: #94a3b8;
}

body.dark-mode .comment-metadata a:hover {
    color: #60a5fa;
}

body.dark-mode .edit-link a {
    background: rgba(96, 165, 250, 0.1);
}

body.dark-mode .edit-link a:hover {
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    color: #0A0F1C;
}

body.dark-mode .comment-content {
    color: #e4e4e7;
}

body.dark-mode .comment-content a {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

body.dark-mode #respond {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #reply-title {
    color: #ffffff;
}

body.dark-mode .logged-in-as {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

body.dark-mode .logged-in-as a {
    color: #60a5fa;
}

body.dark-mode .comment-form-comment label {
    color: #ffffff;
}

body.dark-mode .comment-form-comment textarea {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

body.dark-mode .comment-form-comment textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.dark-mode .comment-form-comment textarea::placeholder {
    color: #64748b;
}

body.dark-mode .character-counter {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode .character-counter .current {
    color: #60a5fa;
}

body.dark-mode .required-field-message {
    color: #94a3b8;
}

body.dark-mode .comments-section .navigation {
    border-top-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .comments-section .navigation a {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .comments-section .navigation a:hover {
    background: var(--primary, #00D9FF);
    color: #ffffff;
}

body.dark-mode .comment-reply-link {
    background: #334155;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .comment-reply-link:hover {
    background: var(--primary, #00D9FF);
    color: #ffffff;
    border-color: var(--primary, #00D9FF);
}

body.dark-mode .form-submit .submit {
    background: var(--primary, #00D9FF);
    color: #ffffff;
}

body.dark-mode .form-submit .submit:hover {
    background: var(--primary-dark, #00B8E6);
}

body.dark-mode .no-comments {
    color: #94a3b8;
}

body.dark-mode .no-comments h3 {
    color: #ffffff;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .comments-section.enhanced {
        padding: 25px 20px;
    }

    .commentlist .children {
        padding-left: 20px;
    }

    .comment-meta {
        flex-direction: column;
        gap: 10px;
    }

    .comment-author.vcard {
        width: 100%;
    }

    #respond {
        padding: 20px;
    }

    .form-submit {
        flex-direction: column;
        width: 100%;
    }

    .form-submit .submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .comments-section.enhanced {
        padding: 20px 15px;
    }

    .comments-section h3#comments {
        font-size: 1.4rem;
    }

    .comment-body {
        padding: 15px;
    }

    .commentlist .children {
        padding-left: 10px;
    }

    #reply-title {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .comment-form-comment textarea {
        min-height: 120px;
        padding: 12px;
    }
}