:root {
    --primary-color-start: #4b6cb7;
    --primary-color-end: #182848;
    --secondary-color-start: #ff8a00;
    --secondary-color-end: #e52e71;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --header-gradient: linear-gradient(90deg, var(--primary-color-start) 0%, var(--primary-color-end) 100%);
    --button-gradient: linear-gradient(90deg, var(--primary-color-start) 0%, var(--primary-color-end) 100%);
    --line-gradient: linear-gradient(90deg, var(--secondary-color-start), var(--secondary-color-end));
    --text-primary: #333;
    --text-secondary: #555;
    --text-light: #777;
    --border-color: #eaeaea;
    --background-light: #f8f9fa;
    --background-white: #fff;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-dark: rgba(0, 0, 0, 0.1);
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --like-color: #4b6cb7;
    --dislike-color: #e52e71;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--background-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.comments-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--background-white);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.comments-header {
    background: var(--header-gradient);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.comments-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.comments-header p {
    opacity: 0.9;
}

.comments-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--line-gradient);
    animation: headerLine 3s infinite alternate;
}

.comment-form {
    padding: 25px;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color-start);
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--button-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-dark);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
}

.btn-success {
    background: var(--success-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.comments-list {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.comment {
    display: flex;
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-light);
    animation: slideIn 0.5s ease-out;
    transition: transform 0.3s ease;
    position: relative;
}

.comment:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.comment-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 15px;
    flex-shrink: 0;
    border: 3px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.comment:hover .comment-avatar {
    border-color: var(--primary-color-start);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color-start);
    font-size: 1.1rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #888;
}

.comment-text {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.7;
}

.comment-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.comment-action:hover {
    color: var(--primary-color-start);
    background: #e9ecef;
}

.comment-action.liked {
    color: var(--like-color);
    font-weight: bold;
    background: #e3f2fd;
}

.comment-action.disliked {
    color: var(--dislike-color);
    font-weight: bold;
    background: #ffebee;
}

.comment-action.reported {
    color: var(--danger-color);
    background: #f8d7da;
}

.comment-action.own-comment {
    background: #e3f2fd;
}

.comment-edit-form {
    margin-top: 10px;
}

.comment-edit-form textarea {
    min-height: 100px;
    margin-bottom: 10px;
}

.edit-actions {
    display: flex;
    gap: 10px;
}

/* Replies Section */
.reply-section {
    display: none;
    padding-right: 20px;
    margin-top: 15px;
    border-right: 2px solid var(--border-color);
}

.reply-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.reply-form .form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.reply-form textarea.form-control {
    min-height: 80px;
}

.reply-form .btn {
    padding: 8px 18px;
    font-size: 0.9rem;
}

.reply-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.cancel-reply-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cancel-reply-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.reply-list .comment {
    box-shadow: none;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
}

.new-comment {
    border-right: 4px solid var(--primary-color-start);
    animation: highlight 2s ease;
}

.comments-footer {
    padding: 15px;
    text-align: center;
    background-color: var(--background-light);
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes headerLine {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes highlight {
    0% { background-color: rgba(75, 108, 183, 0.2); }
    100% { background-color: var(--background-white); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--header-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #3a5998 0%, #152642 100%);
}

/* Responsive design */
@media (max-width: 768px) {
    body { padding: 10px; }
    .comment {
        flex-direction: column;
    }
    .comment-avatar {
        margin-left: 0;
        margin-bottom: 15px;
    }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .comment-date {
        margin-top: 5px;
    }
    .comment-actions {
        gap: 10px;
    }
    .reply-form-actions,
    .edit-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .comment-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .comment-action {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}