/* Comments Section Styling */
.comments-section {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.comments-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.comment-count {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Add Comment Form */
.add-comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.add-comment-form h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.char-counter {
    color: #666;
    font-size: 0.85em;
}

.char-counter.warning {
    color: #e67e22;
}

.char-counter.error {
    color: #e74c3c;
}

.comment-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.comment-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

/* Comments List */
.comments-list {
    margin-top: 20px;
}

.comment {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.comment:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

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

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
    color: #666;
}

.comment-date {
    color: #7f8c8d;
}

.edited-badge {
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

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

.comment-action-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.comment-action-btn.edit {
    color: #3498db;
    border-color: #3498db;
}

.comment-action-btn.delete {
    color: #e74c3c;
    border-color: #e74c3c;
}

.comment-action-btn:hover {
    background: currentColor;
    color: white;
}

.comment-text {
    line-height: 1.6;
    color: #2c3e50;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Edit Form */
.edit-comment-form {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.edit-comment-form .comment-textarea {
    min-height: 80px;
}

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

.edit-save-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.edit-cancel-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.edit-save-btn:hover {
    background: #219a52;
}

.edit-cancel-btn:hover {
    background: #7f8c8d;
}

/* Login Required Message */
.login-required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.login-required a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.login-required a:hover {
    text-decoration: underline;
}

/* Empty State */
.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* Messages */
.comment-message {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.comment-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.comment-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comments-section {
        padding: 15px 0;
    }
    
    .add-comment-form {
        padding: 15px;
    }
    
    .comment {
        padding: 15px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-actions {
        margin-top: 10px;
    }
    
    .comment-form-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .edit-form-actions {
        flex-direction: column;
    }
}
