/* 
 * ICHD Custom Comments CSS
 * Modern UI Update - Clean, Card-based, Responsive
 */

/* --- Main Container --- */
#comments {
    margin-top: 60px;
    padding: 40px;
    background-color: #f8fafc; /* Light Slate Background */
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* Header Title */
.comments-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 30px;
    color: #1e293b;
    position: relative;
    padding-right: 15px;
    display: inline-block;
}

.comments-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 100%;
    background-color: var(--secondary-color, #fbbf24);
    border-radius: 4px;
}

/* --- Comment List --- */
.comment-list, .children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list > li {
    margin-bottom: 20px;
}

/* Individual Comment Card */
.comment-body {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-body:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Mobile: Stack vertically */
@media (max-width: 600px) {
    .comment-body {
        flex-direction: column;
        gap: 15px;
        padding: 16px;
    }
}

/* Avatar */
.comment-author.vcard {
    flex-shrink: 0;
}

.comment-author .avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px; /* Soft square */
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* Content Wrapper */
.comment-content-wrapper {
    flex: 1;
    width: 100%;
}

/* Author Name */
.comment-body .fn {
    font-style: normal;
    font-weight: 800;
    font-size: 1.1rem;
    color: #1e3a8a; /* Primary */
    display: block;
    line-height: 1.2;
    margin-bottom: 4px;
}

.comment-body .fn a {
    color: inherit;
    text-decoration: none;
}

/* Meta Data (Date) */
.comment-metadata {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: block;
    font-weight: 500;
}

.comment-metadata a {
    color: inherit;
    text-decoration: none;
}

/* Comment Text */
.comment-content p {
    margin: 0 0 12px;
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
}

/* Reply Button */
.reply {
    text-align: left;
    margin-top: 10px;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s;
}

.comment-reply-link:hover {
    background: var(--primary-color, #1e3a8a);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.3);
}

/* Nested Comments */
.children {
    margin-right: 30px; /* Indent for RTL */
    margin-top: 20px;
    border-right: 3px solid #e2e8f0;
    padding-right: 20px;
}

@media (max-width: 600px) {
    .children {
        margin-right: 10px;
        padding-right: 10px;
        border-right: 2px solid #e2e8f0;
    }
    #comments {
        padding: 20px;
    }
}

/* --- COMMENT FORM SECTION --- */

.comment-respond {
    margin-top: 60px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.comment-reply-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
}

.comment-reply-title small a {
    font-size: 0.9rem;
    color: #ef4444;
    font-weight: normal;
    background: #fee2e2;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Full width for Comment Textarea and Cookies Consent */
.comment-form-comment, 
.comment-form-cookies-consent, 
.form-submit,
.comment-notes {
    grid-column: 1 / -1;
}

.comment-form p {
    margin: 0;
}

/* Labels */
.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
}

/* Inputs styling */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid #e2e8f0; /* Thicker border */
    background: #f8fafc;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease-in-out;
}

/* Input Focus State */
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color, #1e3a8a);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.comment-form textarea {
    min-height: 160px;
    resize: vertical;
}

/* Submit Button */
.submit {
    width: 100%; 
    background: linear-gradient(135deg, var(--primary-color, #1e3a8a) 0%, #1e40af 100%);
    color: #fff;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.3);
}

.submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.4);
    filter: brightness(110%);
}

/* Cookies Checkbox */
.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
}

.comment-form-cookies-consent input {
    width: 20px !important;
    height: 20px !important;
    accent-color: var(--primary-color, #1e3a8a);
    cursor: pointer;
}

.comment-form-cookies-consent label {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .comment-form {
        grid-template-columns: 1fr; /* Stack inputs */
        gap: 15px;
    }
    .comment-respond {
        padding: 25px;
    }
    #comments {
        padding: 20px;
    }
}

/* --- DARK MODE SUPPORT --- */
.dark #comments {
    background-color: #1e293b; /* Dark Slate */
    border-color: #334155;
}

.dark .comments-title {
    color: #f1f5f9;
}

.dark .comment-body {
    background: #0f172a;
    border-color: #334155;
}

.dark .comment-body:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dark .comment-author .avatar {
    border-color: #334155;
}

.dark .comment-author .fn {
    color: #60a5fa; /* Light Blue */
}

.dark .comment-metadata {
    color: #94a3b8;
}

.dark .comment-content p {
    color: #cbd5e1;
}

.dark .comment-reply-link {
    background: #334155;
    color: #cbd5e1;
}

.dark .comment-reply-link:hover {
    background: #60a5fa;
    color: #0f172a;
}

.dark .children {
    border-right-color: #334155;
}

/* Dark Mode Form */
.dark .comment-respond {
    background: #0f172a;
    border-color: #334155;
}

.dark .comment-reply-title {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

.dark .comment-form label {
    color: #cbd5e1;
}

.dark .comment-form input[type="text"],
.dark .comment-form input[type="email"],
.dark .comment-form input[type="url"],
.dark .comment-form textarea {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .comment-form input:focus,
.dark .comment-form textarea:focus {
    border-color: #60a5fa;
    background: #1e293b;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

.dark .comment-form-cookies-consent {
    background: #1e293b;
}

.dark .comment-form-cookies-consent label {
    color: #94a3b8;
}