/* تعليقات - تصميم خلفية داكنة وألوان متناسقة */
body,
.comment-section {
    background-color: #121212;
    color: #eee;
}

.comment-section {
    max-width: 720px;
    margin: 30px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1e1e1e;
    border-radius: 10px;
    padding: 25px 30px;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
    color: #eee;
}

.comment-section h2 {
    text-align: center;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 30px;
    color: #bb86fc;
}

#comment-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#comment-form input,
#comment-form textarea {
    background: #2c2c2c;
    color: #eee;
    border: 1.5px solid #444;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#comment-form textarea {
    min-height: 90px;
}

#comment-form input:focus,
#comment-form textarea:focus {
    border-color: #bb86fc;
    outline: none;
    box-shadow: 0 0 8px #bb86fc;
}

#comment-form button {
    align-self: flex-end;
    background-color: #bb86fc;
    color: #121212;
    font-weight: 700;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#comment-form button:hover {
    background-color: #9a6de1;
}

#comments {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* تعليق واحد */
.comment {
    background: #272727;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
    position: relative;
    font-size: 15px;
    color: #eee;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    border-left: 4px solid transparent;
}

/* اسم صاحب التعليق */
.comment .name {
    font-weight: 700;
    color: #bb86fc;
    margin-bottom: 6px;
    font-size: 16px;
    position: relative;
    display: inline-block;
}

/* سهم يسبق الاسم في الردود */
.comment.reply .name::before {
    content: "→ ";
    color: #bb86fc;
    font-weight: 700;
}

/* نص "رد على" بجانب اسم الرد */
.comment.reply .name::after {
    content: attr(data-reply-to);
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-left: 6px;
}

/* مسافة بادئة للردود مع تلوين الحد */
.comment.reply {
    padding-left: 30px;
    border-left-color: #bb86fc;
    background: #2a2a2a;
    border-radius: 12px;
}

/* نص التعليق */
.comment .text {
    white-space: pre-wrap;
    margin-bottom: 10px;
}

/* معلومات التعليق (وقت، أزرار) */
.comment .meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #aaa;
    align-items: center;
    user-select: none;
}

.comment .meta .time {
    flex-grow: 1;
    font-style: italic;
    color: #ccc;
}

/* أزرار التحكم */
.comment .meta span.action {
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 600;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 5px;
}

.comment .meta span.action:hover {
    color: #bb86fc;
    background-color: rgba(187, 134, 252, 0.15);
}

/* زر اللايك - قلب وردي */
.comment .meta span.action.like::before {
    content: "♥";
    font-size: 18px;
    color: #e91e63;
    font-weight: 700;
    user-select: none;
}

/* زر الرد */
.comment .meta span.action.reply-btn::before {
    content: "↪";
    font-size: 18px;
    color: #bb86fc;
    font-weight: 700;
    user-select: none;
}

/* زر الحذف */
.comment .meta span.action.delete::before {
    content: "🗑️";
    font-size: 18px;
}

/* تصميم الردود */
.comment .replies {
    margin-top: 18px;
    margin-left: 20px;
    border-left: 2px solid #444;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #1f1f1f;
    border-radius: 0 8px 8px 0;
}

/* صندوق الردود */
.reply-wrapper {
    background: #2c2c2c;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.reply-wrapper textarea {
    width: 100%;
    min-height: 80px;
    background: #1e1e1e;
    color: #eee;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.reply-wrapper button.send-reply {
    margin-top: 10px;
    background-color: #bb86fc;
    color: #121212;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reply-wrapper button.send-reply:hover {
    background-color: #9a6de1;
}

/* زر عرض الردود */
.show-replies-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    align-self: flex-start;
    padding: 5px 10px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.show-replies-btn:hover {
    color: #bb86fc;
}

.username {
    font-weight: 700;
    color: #bb86fc;
    margin-right: 8px;
}

.reply-to {
    font-size: 13px;
    color: #ccc;
    margin-left: 6px;
    font-style: italic;
}

.reply-to-name {
    font-weight: 600;
    color: #90caf9;
}

.reply-name-input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid #444;
    background: #2c2c2c;
    color: #eee;
    font-family: inherit;
    font-size: 14px;
}

.reply-name-input:focus {
    border-color: #bb86fc;
    outline: none;
    box-shadow: 0 0 8px #bb86fc;
}

.toggle-replies-btn {
    margin-top: 8px;
    padding: 6px 12px;
    border: none;
    background-color: #1f1f1f;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.toggle-replies-btn:hover {
    background-color: #333;
}