/* ====================================
   MODERN COMMENTS STYLING
   ==================================== */

/* Main Comments Wrapper */
.modern-comments-wrapper {
    max-width: 100%;
    margin: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Comments Header */
.comments-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.comment-icon {
    color: #4a90e2;
    flex-shrink: 0;
}

.comment-count {
    color: #4a90e2;
    font-weight: 800;
}

/* Comment List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.comment-list > li {
    margin-bottom: 24px;
    list-style: none;
}

/* Individual Comment Box */
.comment-box {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.comment-box:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

/* Comment Avatar */
.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 2px solid #f3f4f6;
    transition: border-color 0.3s ease;
}

.comment-box:hover .comment-avatar img {
    border-color: #4a90e2;
}

/* Comment Content */
.comment-content {
    flex: 1;
    min-width: 0;
}

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

.comment-author {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

.comment-author a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-author a:hover {
    color: #4a90e2;
}

.comment-date {
    font-size: 13px;
    color: #6b7280;
}

.comment-date::before {
    content: "•";
    margin-right: 8px;
}

/* Comment Text */
.comment-text {
    margin: 12px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.comment-text p {
    margin: 0 0 10px 0;
}

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

/* Comment Reply Button */
.comment-reply {
    margin-top: 12px;
}

.comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #4a90e2;
    background: #f0f7ff;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-reply a::before {
    content: "↩";
    font-size: 14px;
}

.comment-reply a:hover {
    background: #4a90e2;
    color: #ffffff;
    border-color: #4a90e2;
}

/* Nested Comments (Children) */
.children {
    list-style: none;
    padding-left: 40px;
    margin-top: 20px;
}

.children .comment-box {
    background: #f9fafb;
}

.children .children .comment-box {
    background: #ffffff;
}

/* Moderation Notice */
.comment-awaiting-moderation {
    display: inline-block;
    padding: 4px 10px;
    margin: 8px 0;
    font-size: 13px;
    color: #d97706;
    background: #fef3c7;
    border-radius: 4px;
    font-style: normal;
}

/* Comments Pagination */
.comments-pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.comments-pagination .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comments-pagination a,
.comments-pagination span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comments-pagination a {
    color: #4a90e2;
    background: #ffffff;
}

.comments-pagination a:hover {
    background: #4a90e2;
    color: #ffffff;
    border-color: #4a90e2;
}

.comments-pagination .current {
    background: #4a90e2;
    color: #ffffff;
    border-color: #4a90e2;
    font-weight: 600;
}

.comments-pagination svg {
    width: 16px;
    height: 16px;
}

/* ====================================
   COMMENT FORM STYLING
   ==================================== */

.comment-form-wrapper {
    margin-top: 40px;
    padding: 30px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.modern-comment-form {
    max-width: 100%;
}

/* Form Title */
.comment-reply-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.reply-title-icon {
    font-size: 24px;
}

.comment-reply-title small {
    margin-left: auto;
}

.comment-reply-title small a {
    font-size: 14px;
    font-weight: 500;
    color: #ef4444;
    text-decoration: none;
    padding: 6px 12px;
    background: #fee2e2;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.comment-reply-title small a:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Form Fields Grid */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 20px;
}

/* Labels */
.modern-comment-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

/* Input Fields */
.modern-comment-form input[type="text"],
.modern-comment-form input[type="email"],
.modern-comment-form input[type="url"],
.modern-comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.modern-comment-form input[type="text"]:focus,
.modern-comment-form input[type="email"]:focus,
.modern-comment-form input[type="url"]:focus,
.modern-comment-form textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modern-comment-form textarea {
    resize: vertical;
    min-height: 140px;
}

/* Submit Button */
.form-submit {
    margin-top: 20px;
}

.form-submit input[type="submit"] {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.2);
}

.form-submit input[type="submit"]:hover {
    background: linear-gradient(135deg, #357abd 0%, #2868a8 100%);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
}

.form-submit input[type="submit"]:active {
    transform: translateY(0);
}

/* reCAPTCHA Disclaimer */
.recaptcha-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 16px;
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 6px;
    border-left: 3px solid #9ca3af;
}

.recaptcha-disclaimer svg {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.6;
}

.recaptcha-disclaimer a {
    color: #4a90e2;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.recaptcha-disclaimer a:hover {
    border-bottom-color: #4a90e2;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 768px) {
    .modern-comments-wrapper {
        margin: 30px 0;
    }

    .comments-title {
        font-size: 20px;
    }

    .comment-box {
        flex-direction: column;
        padding: 16px;
    }

    .comment-avatar {
        align-self: flex-start;
    }

    .children {
        padding-left: 20px;
    }

    .comment-form-wrapper {
        padding: 20px;
    }

    .comment-reply-title {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-reply-title small {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .comments-title {
        font-size: 18px;
    }

    .comment-box {
        padding: 12px;
    }

    .comment-avatar img {
        width: 40px;
        height: 40px;
    }

    .children {
        padding-left: 10px;
    }

    .comment-form-wrapper {
        padding: 16px;
    }

    .form-submit input[type="submit"] {
        width: 100%;
        padding: 12px 24px;
    }
}

/* ====================================
   DARK MODE SUPPORT (Optional)
   ==================================== */

@media (prefers-color-scheme: dark) {
    .modern-comments-wrapper {
        color: #e5e7eb;
    }

    .comments-title,
    .comment-author,
    .comment-author a {
        color: #f3f4f6;
    }

    .comment-box {
        background: #1f2937;
        border-color: #374151;
    }

    .comment-box:hover {
        border-color: #4a90e2;
        box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    }

    .comment-text {
        color: #d1d5db;
    }

    .comment-date {
        color: #9ca3af;
    }

    .children .comment-box {
        background: #111827;
    }

    .comment-form-wrapper {
        background: #1f2937;
        border-color: #374151;
    }

    .modern-comment-form input[type="text"],
    .modern-comment-form input[type="email"],
    .modern-comment-form input[type="url"],
    .modern-comment-form textarea {
        background: #111827;
        border-color: #374151;
        color: #f3f4f6;
    }

    .modern-comment-form label {
        color: #d1d5db;
    }

    .recaptcha-disclaimer {
        background: #111827;
        color: #9ca3af;
    }
}

/* ====================================
   ANIMATIONS
   ==================================== */

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

.comment-list > li {
    animation: slideIn 0.4s ease forwards;
}

.comment-list > li:nth-child(1) { animation-delay: 0.05s; }
.comment-list > li:nth-child(2) { animation-delay: 0.1s; }
.comment-list > li:nth-child(3) { animation-delay: 0.15s; }
.comment-list > li:nth-child(4) { animation-delay: 0.2s; }
.comment-list > li:nth-child(5) { animation-delay: 0.25s; }
